Next.js Discord

Discord Forum

[custom formatter threw an exception] when using bun

Unanswered
English Shepherd posted this in #help-forum
Open in Discord
Avatar
English ShepherdOP
First, i was trying to build my website with bun then the [custom formatter threw an exception] error occured.
bunx --bun next build
   ▲ Next.js 15.0.2
   - Environments: .env

   Creating an optimized production build ...
 ✓ (serwist) Bundling the service worker script with the URL '/sw.js' and the scope '/'...
 ✓ Compiled successfully

./components/typewriter.tsx
45:6  Warning: React Hook useEffect has a missing dependency: 'animate'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./lib/spam.ts
56:1  Warning: Assign instance to a variable before exporting as module default  import/no-anonymous-default-export

./lib/egm.ts
53:1  Warning: Assign instance to a variable before exporting as module default  import/no-anonymous-default-export

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
 ✓ Linting and checking validity of types
   Collecting page data  ...[custom formatter threw an exception]

> Build error occurred
[custom formatter threw an exception]

Then, i tried without the --bun argument (bunx next build) and it worked. But when i run my website with bunx --bun next start it works, but when i enter a page that was working it doesnt work. (500 Internal Server Error) and it prints ⨯ [custom formatter threw an exception]

0 Replies