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
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'
}
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 function11 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 functionAnswer
@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
Eulophid waspOP
Let me make the change and then ill update, great full for the fast response
Original message was deleted
Eulophid waspOP
GET https://workshops.geniuslabs.live/_next/static/chunks/app/%5Btheme%5D/%5Bid%5D/page-547f656a27afe17f.js net::ERR_ABORTED 404 (Not Found)
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 👍