-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
and my .env file looks like this: (note that i removed some values since they are private) DISCORD_BOT_TOKEN=my_secret_here MONGODB_URI=SEECREEET NEXTAUTH_URL=http://localhost:3000 SESSION_SECRET=secret PORT=3000 |
Beta Was this translation helpful? Give feedback.
-
Good to know: environment variables specified in this way will always be included in the JavaScript bundle, prefixing the environment variable name with NEXT_PUBLIC_ only has an effect when specifying them through the environment or .env files. Have you checked this out? |
Beta Was this translation helpful? Give feedback.
-
Can you check the log on your console where you are running the server, not the browser? It should be visible there. The browser is client-side, so without prefixing the env variable with NEXT_PUBLIC, it would always be undefined on the client. |
Beta Was this translation helpful? Give feedback.
-
i think i found the issue, i use "use client"; in the layout.js which makes everything clientside o-o |
Beta Was this translation helpful? Give feedback.
i think i found the issue, i use "use client"; in the layout.js which makes everything clientside o-o