Pattern to programmatically set config values? Runtime config not available in serverless, why? #14308
Unanswered
eric-burel
asked this question in
Help
Replies: 1 comment
-
Specifically, in the documentation for |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys,
I still struggle to answer 2 questions in Next 9.4, regarding config:
package.json
version available to the client.Intuitively I've written this:
Note that I can't get this info from environment, hence the idea of using public config.
Which raises even more questions:
publicRuntimeConfig
is not available in serverless environment. Why? I don't see the point/technical reason for this.nextConfig.env
value instead. But it's now unclear how to handle public variables this way. Should I name donextConfig.env.NEXT_PUBLIC_VERSION = packageJSON.version
for instance? Is it safe?I've raised similar question in the
.env
support RFC but it wasn't the most appropriate place, so I am opening a separate discussion.Edit: Second use case for the server is passing CORS whitelist.
You may want to preprocess the environment variable, by splitting the array, before including it in the config. It's not doable at this point.
Beta Was this translation helpful? Give feedback.
All reactions