next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Unable to build next js

Open Orygaw opened this issue 1 year ago • 1 comments

Link to the code that reproduces this issue

https://github.com/render-examples/nextjs-hello-world

To Reproduce

Hello, i Used FreeBSD 13 and nodejs v21.7.3

yarn

yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[----------------------------] 0/28(node:37703) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 17.05s.
[user@sXX]:<~/domains/mydomain.tld/nextjs-hello-world>$ yarn build
yarn run v1.22.19
$ next build
   ▲ Next.js 14.1.3

 ✓ Linting and checking validity of types    
   Creating an optimized production build ...
   Downloading swc package @next/swc-freebsd-x64...
 ⨯ Failed to download swc package from https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-14.1.3.tgz
Error: request failed with status 404
    at /usr/home/user/domains/mydomain.tld/nextjs-hello-world/node_modules/next/dist/lib/download-swc.js:96:23
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async extractBinary (/usr/home/user/domains/mydomain.tld/nextjs-hello-world/node_modules/next/dist/lib/download-swc.js:90:9)
    at async downloadNativeNextSwc (/usr/home/user/domains/mydomain.tld/nextjs-hello-world/node_modules/next/dist/lib/download-swc.js:151:9)
    at async tryLoadNativeWithFallback (/usr/home/user/domains/mydomain.tld/nextjs-hello-world/node_modules/next/dist/build/swc/index.js:286:5)
    at async /usr/home/user/domains/mydomain.tld/nextjs-hello-world/node_modules/next/dist/build/swc/index.js:270:40

I added to my package.json

"resolutions": {
    "rollup": "npm:@rollup/wasm-node"
  },

then i used yarn and move on.

yarn build"caused an error that I did not understand.

yarn run v1.22.19
$ next build
   ▲ Next.js 14.1.3

 ✓ Linting and checking validity of types    
   Creating an optimized production build ...
 ⚠ Attempted to load @next/swc-freebsd-x64, but it was not installed
 ⨯ Failed to load SWC binary for freebsd/x64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
Compiler server unexpectedly exited with code: 1 and signal: null

> Build error occurred
Error: Jest worker encountered 1 child process exceptions, exceeding retry limit
    at ChildProcessWorker.initialize (/usr/home/user/domains/mydomain.tld/nextjs-hello-world/node_modules/next/dist/compiled/jest-worker/index.js:1:11580)
    at ChildProcessWorker._onExit (/usr/home/user/domains/mydomain.tld/nextjs-hello-world/node_modules/next/dist/compiled/jest-worker/index.js:1:12545)
    at ChildProcess.emit (node:events:531:35)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
  type: 'WorkerError'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Do you have any idea to run Next.js on FreeBSD?

Current vs. Expected behavior

building nextjs

Provide environment information

node -v
v21.7.3

yarn -v
1.22.19

 npm -v
9.6.6

Which area(s) are affected? (Select all that apply)

Not sure, SWC

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

No response

Orygaw avatar Jun 05 '24 21:06 Orygaw

This issue has been automatically marked as stale due to inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

nextjs-bot avatar Dec 02 '25 23:12 nextjs-bot

This issue has been automatically closed due to inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

nextjs-bot avatar Dec 10 '25 23:12 nextjs-bot