Skip to content
Discussion options

You must be logged in to vote

Have you tried with prefix NEXT_PUBLIC_
https://nextjs.org/blog/next-9-4#new-environment-variables-support

Otherwise
Did you set env in next.config.js

module.exports = {
    env: {
        ENV_VAR_NAME: process.env.ENV_VAR_NAME
    }
}

When you run npm run dev, did you see like this

ready - started server on http://localhost:3000
info  - Loaded env from .env
event - compiled successfully

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@visakadivines
Comment options

Answer selected by visakadivines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants