Cannot destructure property `publicRuntimeConfig` of 'undefined' or 'null'. (v9.5.0)
See original GitHub issueBug report
After upgrading from 9.4.4 to 9.5.0 I get an error after building (in dev mode all works fine):
Cannot destructure property `publicRuntimeConfig` of 'undefined' or 'null'.
Code:
import getConfig from "next/config";
const { publicRuntimeConfig } = getConfig()
System information
- OS: macOS
- Browser: chrome
- Version of Next.js: 9.5.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:12
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 (...
Read more >Contribute to vercel/next.js · GitHub
5. [Hapi + Nextjs] custom-server-hapi got a [ERR_HTTP_HEADERS_SENT]: Cannot ... Cannot destructure property `publicRuntimeConfig` of 'undefined' or 'null'.
Read more >Next.js error: Cannot destructure property? : r/learnjavascript
AuthContext: {$$typeof: Symbol(react.context), _calculateChangedBits: null, _currentValue: undefined, _currentValue2: undefined, _threadCount: 0 ...
Read more >cannot read property 'usecontext' of null nextjs - You.com
I think your bug related to SSR. If you run the code with SSR, the initializeState will receive undefined. But initializeState should be...
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
I also have next-transpile-modules in my next.config.js and running into this issue when running my tests? Any recommendations?
I’ve got the same error too, when I’ve introduced getStaticProps. it occurred when
next dev
subcommand executed, but thenext build && next start
did not the case.Version of Next.js: 9.5.1