Cannot destructure property `serverRuntimeConfig` of 'undefined' or 'null'
See original GitHub issueCan serverRuntimeConfig
be used when in serverless mode?
The following code:
import getConfig from 'next/config';
const { serverRuntimeConfig } = getConfig();
returns
Cannot destructure property serverRuntimeConfig of 'undefined' or 'null'
For publicRuntimeConfig
there is an error saying that it can’t be used but not for that one.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Next.js Cannot destructure property 'publicRuntimeConfig' of ...
We have this function below which is stored in common folder to be used for both client and server, and it fails when...
Read more >[next.js] Cannot destructure property 'BACKEND_URL ... - GitLab
publicRuntimeConfig' as it is undefined. I have an app that's written in next.js, that has env variables. App works perfectly locally ( yarn ......
Read more >Next.js error: Cannot destructure property? : r/learnjavascript
I am following a tutorial and I cannot figure out why Next keeps throwing this error: TypeError: Cannot destructure property 'loginUser' of ...
Read more >Cannot destructure property 'styles' of 'this.context' as it is null
Learn how to fix Next.js error: TypeError: Cannot destructure property 'styles' of 'this.context' as it is null.
Read more >next.config.js: Runtime Configuration
Place any server-only runtime config under serverRuntimeConfig . Anything accessible to both client and server-side code should be under publicRuntimeConfig . A ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you are using a custom server, be sure to use
getConfig
only after initialisation of the Next app:When deploying to ZEIT Now the target is forced to
serverless
– you cannot deploy aserver
Next.js app to ZEIT Now!