next.js: Cannot build nextjs app on FreeBSD

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: freebsd
  Arch: x64
  Version: FreeBSD 13.2-RELEASE #0 releng/13.2-n254617-525ecfdad597-dirty: Wed May 31 19:03:43 CEST 2023     
Binaries:
  Node: 20.10.0
  npm: 9.6.6
  Yarn: 1.22.19
  pnpm: N/A
Relevant Packages:
  next: 14.0.4 / 14.0.5-canary.29
  eslint-config-next: 14.0.4
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which example does this report relate to?

hello-world

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

yarn build / yarn start

Describe the Bug

I have error:

[user@s62]:<~/domains/test.net/my-app>$ yarn build
yarn run v1.22.19
$ next build
   ▲ Next.js 14.0.4

   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.0.4.tgz
unhandledRejection Error: request failed with status 404

Even I adding to .babelrc:

{
  "presets": ["next/babel"]
}

and swcMinifty: false to next.config.js build still failing

Expected Behavior

App should build

To Reproduce

yarn build

About this issue

  • Original URL
  • State: open
  • Created 6 months ago
  • Reactions: 4
  • Comments: 15

Most upvoted comments

I had the same problem, even if I built the next-swc with rust it still crashed. I managed to get it running by using @next/swc-wasm-nodejs, and then change the node_modules/next/dist/build/swc/index.js, line 247, shouldLoadWasmFallbackFirst to true.

hope it helps.

The FreeBSD version I’m using: 14.0-RELEASE.

@tinola I don’t think it’s the version of FreeBSD matters here, it’s the next.js version. I’m using 14.1.0. could you try this version of next?