Strange error with npm run build #81267
Unanswered
TomasErikssonDev
asked this question in
Help
Replies: 1 comment
-
|
Context
Cause
Fix (minimum viable)
Notes
|
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.
-
Summary
Hello, I started last month with a new nextjs project and it worked fine til I added another .ts-file with useEffect in a hook-function and then it work in dev mode but not when I build:
Error occurred prerendering page "/xxx". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of undefined (reading '__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE')
This doesn't solve it
'use client';
export const dynamic = 'force-dynamic';
Why is the error so obfuscated? Why does an useEffect makes the difference..?
If I dig in the minified code I find this:
return Q.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE&&(0,p.useEffect)(()=>{r&&(e?ee(n,
I'm not so experienced with NextJS, but the problem seems ridiculous hard to solve.
Kind regards
Tomas
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions