Next.js Discord

Discord Forum

Unexpected end of JSON input

Answered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
Just created a completely new nextjs project using the create next app command and am already getting errors when I try to build it? Not sure what's going on but this is ahppening with all my nextjs projects. Wtf am I supposed to do.

seifabdelaziz@Mac my-next-app % bun run build
$ next build
   ▲ Next.js 15.0.3

   Creating an optimized production build ...
Failed to compile.

./src/app/page.tsx + 1 modules
Unexpected end of JSON input


> Build failed because of webpack errors
error: script "build" exited with code 1
seifabdelaziz@Mac my-next-app %
Answered by Transvaal lion
i was able to fix the issue by completely uninstall node and reinstalling it agian
View full answer

7 Replies

Belgian Hare
@Transvaal lion Can you show the source of /src/app/page.tsx?
This error occurs if you run JSON.parse on a malformed JSON string (on the server)
Transvaal lionOP
it's the default page.tsx that you get from runing creat enxt app
Transvaal lionOP
i was able to fix the issue by completely uninstall node and reinstalling it agian
Answer
Transvaal lionOP
no idea what the hell aws happening
Belgian Hare
Transvaal lionOP
ty