Next.js Discord

Discord Forum

Build fails when using Next/Image

Unanswered
itsfinniii posted this in #help-forum
Open in Discord
When building the default page (that is produced when creating a simple Next.js page). When commenting out the import of next/image at the top and all places where the Image component is used, the build seems to work without issues.

When building with the next/image imported, I get the following error in my terminal:
itsfinniii@mac next-web % bun run build
$ next build
   ▲ Next.js 15.1.7

   Creating an optimized production build ...

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


> Build failed because of webpack errors
error: script "build" exited with code 1


Is this a known issue? If so, how do I fix it?

I am running my Next.js project with Bun 1.2.3 on a Mac Mini M4. If any more information is needed, I will happily supply.

1 Reply

Okay, so on my Debian VPS this seems to work, so it seems to be a MacOS issue... I'll look into this.