Chew / ChessTools

The ultimate website for chess players. View your stats across Chess.com, Lichess, FIDE, USCF, and more!
https://chess.tools
GNU General Public License v3.0
10 stars 2 forks source link

[nuxt] [request error] [unhandled] [500] supabaseUrl is required. #1

Closed shinshin86 closed 9 months ago

shinshin86 commented 9 months ago

Hello! It's interesting project.

I would like to try it, but I got the following error

[nuxt] [request error] [unhandled] [500] supabaseUrl is required.

It seems to me that I need to have a .env file with the following credentials for supabase, am I right?

SUPABASE_URL="https://example.supabase.co"
SUPABASE_KEY="<your_key>"

https://supabase.nuxtjs.org/get-started#installation

Chew commented 9 months ago

Huh, that is weird. That does look right though. Is the .env in the executing directory?

Here's what my ENV is filled out:

SUPABASE_URL="https://example.supabase.co" # Required
SUPABASE_KEY="anon key" # Anonymous key
SUPABASE_SERVICE_KEY="service key" # Service key, required
NUXT_TURNSTILE_SECRET_KEY="" # Turnstile key, only needed for registration

Here's an ecosystem.config.cjs file I use to run with pm2. This is also in the root directory, where the .env is:

module.exports = {
  apps: [
    {
      name: 'ChessTools',
      port: '3305',
      exec_mode: 'cluster',
      instances: 'max',
      script: './.output/server/index.mjs'
    }
  ]
}
shinshin86 commented 9 months ago

@Chew Thanks for the reply!

The .env file was not present in the execution directory because I ran it with it cloned from GitHub. (Maybe my explanation was not clear. Sorry about that.)

When I ran it with the .env file in the project root, the error went away and the app started. Thank you very much!

I thought adding these steps to the README would make it easier for other developers to build their environments, so I created a PR. https://github.com/Chew/ChessTools/pull/5

It would be my pleasure if you could check it out.

By the way, the .env file only needed the following description and it seemed to start without any problem at first, but if I am wrong, please point it out to me.

SUPABASE_URL="https://example.supabase.co"
SUPABASE_KEY="<your_key>"
Chew commented 9 months ago

You'll need the service key for some stuff like integrating linking and creating games. We could definitely add an .env.example and put the required values there just for people to know about it. Good advice!