-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a .dev.vars
file for new projects
#189
Comments
I just created a app using getting started but .env.development file not loading. |
|
@himanshu-ntml can you confirm whether the route is being SSR'd or SSG'd? I have just created a dummy project and forced the API route to be SSR'd and it was returning the variable. By default, Next.js tries to SSG everything unless it's unable to. |
@james-elicx i tried with api route too, I got same behaviour. I was still seeing node_env error too. Thank you so much for swift response. |
I guess i missed "force-dynamic". I am not sure why it works with "force dynamic" I did get some warnings
|
It's because it's forcing the route to be SSR'd. A blank API route that returns a fixed response will try to be SSG'd by Next.js. |
Thank you, that makes sense. I’m curious to know why I’m still getting NODE_ENV warnings. Any ideas? |
We should create a
.dev.vars
file as part of C3 when someone creates a new Next.js project, or when they migrate over to using OpenNext (related: #188).This file should include a
NEXTJS_ENV
variable out-of-the-box which defaults todevelopment
. This will be used for determining whether the app is running in development or production locally, so that inlined .env files can be used in the worker.The text was updated successfully, but these errors were encountered: