Next.js Discord

Discord Forum

Page breaking on first load after server start

Unanswered
Norwegian Lundehund posted this in #help-forum
Open in Discord
Norwegian LundehundOP
When i start the app in dev mode and then visit the page, it sometimes gives me the error in the console
Uncaught syntax error: "" literal not terminated before end of script
for the file .../_next/static/app/chunks/layout.js
which is generated by nextJS and i see has some stuff about webpack and more inside, and the page stops loading. I can't make it happen every single time but it happens even if i clear .next folder and browser cache before that. Other times the error doesn't happen and my content loads, but there's no CSS.
For both, a simple refresh or clicking something in the navbar always fixes them.
The above only happen in dev mode.

update: doesnt seem to happen when using turbopack either

1 Reply

Spectacled bear
Try deleting the .next folder if you are working in dev env.