Next.js Discord

Discord Forum

Hi am using next 15.1.4. and i am getting Application error: a client-side exception has occurred.

Answered
Eulophid wasp posted this in #help-forum
Open in Discord
Eulophid waspOP
This error is only happing in the after i made the production build and do npm run start.
https://workshops.geniuslabs.live/robotic-cars-and-stunts/6763b880cb2ae23a03f3d3c2
Ive uploaded the folder structure for this dynamic url.
error : ⨯ ReferenceError: window is not defined
at S (.next/server/app/[theme]/[id]/page.js:1:9821) {
digest: '2012015809'
}
Answered by B33fb0n3
inside your app/[theme]/[id]/page.js you access the window object on the server. On the server a window object does not exists, so it throws the error. Only use the window variable after you checked if it's not undefined typeof windows !== undefined or directly inside a useEffect or function
View full answer

11 Replies

@Eulophid wasp This error is only happing in the after i made the production build and do npm run start. https://workshops.geniuslabs.live/robotic-cars-and-stunts/6763b880cb2ae23a03f3d3c2 Ive uploaded the folder structure for this dynamic url. error : ⨯ ReferenceError: window is not defined at S (.next/server/app/[theme]/[id]/page.js:1:9821) { digest: '2012015809' }
inside your app/[theme]/[id]/page.js you access the window object on the server. On the server a window object does not exists, so it throws the error. Only use the window variable after you checked if it's not undefined typeof windows !== undefined or directly inside a useEffect or function
Answer
Original message was deleted
Eulophid waspOP
517-4d375f64edd31bb1.js:1 Uncaught Error: Minified React error #419; visit https://react.dev/errors/419 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Getting these errors now
@Eulophid wasp Getting these errors now
let's fix your initial issue first. Is your initial issue solved like that: https://nextjs-forum.com/post/1330814547346591836#message-1330816068381577266 <--- click
@Eulophid wasp is your initial issue solved?
@B33fb0n3 <@772497091414196266> is your initial issue solved?
Eulophid waspOP
Yes
happy to help
make sure to open a new thread for your other topic 👍