错误:需要 supabaseUrl (supabase) postgresql

问题描述

我在线使用 supabase postgresql,其中重要的是创建一个 .env 文件,其中保存了我的在线 DMBS 的 URL 和匿名密钥,并且还创建了一个“supabase 客户端”文件以访问 DBMS 和表以及导入“supabase 客户端” "在要求文件中。我已经完成了他们文档中所有相同的事情,但仍然面临错误错误:需要 supabaseUrl”,但我已经输入了 url。

.....................代码...................... ........

import React,{ useState } from 'react'
import './App'
import Login from './Login';
import { browserRouter as Router,Route,Link,NavLink,Switch } from 'react-router-dom';
import {supabase} from './supabaseClient';

return(
    <>
    <div className="container" >
        <div className="heading">
            <h1>SignUp Form</h1>
        </div>

    <form>
    <Router>
        <div className="mb-3">
            <label  className="flabel">Name</label>
            <input type="text" className="fcontrol" placeholder="Enter Your Name"/>
        </div>
        <div className="mb-3">
            <label  className="flabel">Phone</label>
            <input type="tel"  className="fcontrol" placeholder="Enter Your Phone Number"/>
        </div>
        <div className="mb-3">
            <label  className="flabel">Email</label>
            <input type="email"  className="fcontrol" placeholder="Enter Your Email"/>
        </div>
        <div className="mb-3">
            <label  className="flabel">Password</label>
            <input type="password"  className="fcontrol" placeholder="Enter Your Password"/>
        </div>
        
        <div className="mb-3">
        <button className="btn1" >SignUp</button>
        <Link exact to="/Login">
            Have an already acoount? Login
        </Link> 
        </div>

        {/* --------------------- switch ------------------- */}

        <switch>
            <Route exact path="/Login" component={Login} />
                

        </switch>

        </Router>
    </form>

    </div>
    </>


   )
}
export default Form;

.................................supabase 客户端...................... ....

import { createClient } from '@supabase/supabase-js'

const supabaseUrl = process.env.REACT_APP_SUPABASE_URL
const supabaseAnonKey = process.env.REACT_APP_SUPABASE_ANON_KEY

export const supabase = createClient(supabaseUrl,supabaseAnonKey)

解决方法

这个问题可能与.env文件有关 如果“错误:需要 supabaseUrl”,请确保 REACT_APP_SUPABASE_URL.env 文件中是相同的

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...