Replies: 16 comments 24 replies
-
Do you have an example with your code? |
Beta Was this translation helpful? Give feedback.
-
I also have such a problem |
Beta Was this translation helpful? Give feedback.
-
How to fix this? I cant even build a fresh app. This is shame |
Beta Was this translation helpful? Give feedback.
-
same problem here. running |
Beta Was this translation helpful? Give feedback.
-
This error happened to me when I tried to access a page that doesn't exist. |
Beta Was this translation helpful? Give feedback.
-
I have got the same problem. I am open to any solution. |
Beta Was this translation helpful? Give feedback.
-
For what it's worth, I was running into this same issue on Node 16.16.0, and upgrading to 18.5.0 resolved it. 🤷 |
Beta Was this translation helpful? Give feedback.
-
im facing the same issue. next build works fine in my local environment. but vercel build not working. what to do? |
Beta Was this translation helpful? Give feedback.
-
Found a solution that i believe makes sense for why other temporary solutions worked. From what i can tell, vercel is aggressively caching build steps, and useMemo on routes that dont have much data (atleast in my case) are corrupting the cache in some way. All i had to do to resolve the issue is re-deploy without checking |
Beta Was this translation helpful? Give feedback.
-
Was facing the same error in 13.4.2. Went away when removed experimental server actions from the config. My deployments worked before server actions, and they work after removing server actions. |
Beta Was this translation helpful? Give feedback.
-
This issue is resolved for me after talking with @TooTallNate Fix for me was the following:
|
Beta Was this translation helpful? Give feedback.
-
Same here.. using app route, group routing, |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
In my project after running Currently I'm using 13.4.19 version of nextjs Error
|
Beta Was this translation helpful? Give feedback.
-
@jayantWishlist Got this error also today, |
Beta Was this translation helpful? Give feedback.
-
I don't really understand why works doing |
Beta Was this translation helpful? Give feedback.
-
Hi I am getting errors when trying to run next build, when running next dev it works fine
Here is the console output
`
/usr/src/app/<APP_NAME> # next build
warn - You have enabled experimental feature (appDir) in next.config.js.
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
info - Thank you for testing 'appDir' please leave your feedback at https://nextjs.link/app-feedback
info - Creating an optimized production build
info - Compiled successfully
info - Skipping validation of types
info - Linting
info - Collecting page data
[ ] info - Generating static pages (0/4)TypeError: Cannot read properties of null (reading 'useContext')
at exports.useContext (/usr/src/app/<APP_NAME>/node_modules/next/dist/compiled/react/cjs/react.production.min.js:28:118)
at Head (/usr/src/app/<APP_NAME>/.next/server/pages/_error.js:255:34)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:272)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at be (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:106:98)
at de (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:105:424)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:222)
at be (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:106:98)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:213)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
Error occurred prerendering page "/404". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useContext')
at exports.useContext (/usr/src/app/<APP_NAME>/node_modules/next/dist/compiled/react/cjs/react.production.min.js:28:118)
at Head (/usr/src/app/<APP_NAME>/.next/server/pages/_error.js:255:34)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:272)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at be (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:106:98)
at de (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:105:424)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:222)
at be (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:106:98)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:213)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
TypeError: Cannot read properties of null (reading 'useContext')
at exports.useContext (/usr/src/app/<APP_NAME>/node_modules/next/dist/compiled/react/cjs/react.production.min.js:28:118)
at Head (/usr/src/app/<APP_NAME>/.next/server/pages/_error.js:255:34)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:272)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at be (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:106:98)
at de (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:105:424)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:222)
at be (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:106:98)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:213)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
Error occurred prerendering page "/500". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useContext')
at exports.useContext (/usr/src/app/<APP_NAME>/node_modules/next/dist/compiled/react/cjs/react.production.min.js:28:118)
at Head (/usr/src/app/<APP_NAME>/.next/server/pages/_error.js:255:34)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:272)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at be (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:106:98)
at de (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:105:424)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:222)
at be (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:106:98)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:213)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
TypeError: Cannot read properties of null (reading 'useMemo')
at exports.useMemo (/usr/src/app/<APP_NAME>/node_modules/next/dist/compiled/react/cjs/react.production.min.js:29:208)
at Router (/usr/src/app/<APP_NAME>/.next/server/chunks/124.js:1852:38)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:272)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at Zd (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:97:314)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:207)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:9)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:9)
Error occurred prerendering page "/about". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useMemo')
at exports.useMemo (/usr/src/app/<APP_NAME>/node_modules/next/dist/compiled/react/cjs/react.production.min.js:29:208)
at Router (/usr/src/app/<APP_NAME>/.next/server/chunks/124.js:1852:38)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:272)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at Zd (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:97:314)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:207)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:9)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:9)
TypeError: Cannot read properties of null (reading 'useMemo')
at exports.useMemo (/usr/src/app/<APP_NAME>/node_modules/next/dist/compiled/react/cjs/react.production.min.js:29:208)
at Router (/usr/src/app/<APP_NAME>/.next/server/chunks/124.js:1852:38)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:272)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at Zd (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:97:314)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:207)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:9)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:9)
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useMemo')
at exports.useMemo (/usr/src/app/<APP_NAME>/node_modules/next/dist/compiled/react/cjs/react.production.min.js:29:208)
at Router (/usr/src/app/<APP_NAME>/.next/server/chunks/124.js:1852:38)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:272)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at Zd (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:97:314)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:98:207)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:9)
at Z (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:104:91)
at ae (/usr/local/lib/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:99:9)
info - Generating static pages (4/4)
Beta Was this translation helpful? Give feedback.
All reactions