question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Unsupported platform: freebsd

See original GitHub issue

Verify canary release

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

Provide environment information

yarn info v1.22.18 {
name: ‘my-app’,
description: ‘my-app’,
‘dist-tags’: { latest: ‘0.1.0’ },
versions: [ ‘0.1.0’ ],
maintainers: [ { name: ‘mdathrika’, email: ‘mdathrika@ebay.com’ } time: { modified: ‘2022-06-20T15:34:47.301Z’, created: ‘2013-05-30T19:30:56.012Z’, ‘0.1.0’: ‘2013-05-30T19:30:58.974Z’ }, users: { ‘enas-443’: true }, version: ‘0.1.0’, scripts: { start: ‘node server.js’ }, license: ‘Apache License 2.0’,
dependencies: { raptor: ‘>=2.3.0’, optimist: ‘~0.3.5’, ‘express-raptor’: ‘~0.1.2’, express: ‘~3.1.1’, request: ‘~2.16.6’, ‘ebay-global-header’: ‘git://github.scm.corp.ebay.com/cubejs-ebay/ebay-global-header-node.git’, ‘raptor-optimizer-ready-plugin’: ‘git://github.scm.corp.ebay.com/cubejs-ebay/raptor-optimizer-ready-plugin.git’, ‘ebay-ui-components’: ‘git://github.scm.corp.ebay.com/Raptor/RaptorUIComponents.git’, ‘raptor-hot-reload’: ‘~0.1.3’, ‘socket.io’: ‘~0.9.14’, cluster2: ‘git://github.scm.corp.ebay.com/cubejs/cluster2.git’, ‘context-config’: ‘git://github.scm.corp.ebay.com/cubejs/context-config-node.git’, ‘raptor-config’: ‘git://github.scm.corp.ebay.com/cubejs-ebay/raptor-config-node.git’ }, devDependencies: {},
readmeFilename: ‘README.md’,
dist: { shasum: ‘495332e31a4fa9bca5e100798f7cfb30663c73ad’, tarball: ‘https://registry.npmjs.org/my-app/-/my-app-0.1.0.tgz’, integrity: ‘sha512-CLIDEWQdnm3x96rWAQgm9u+jorK1KdGN9SC1qoyHuEc3KyKIw1NJ6fQ3p1NzDMPSpVt01ojiUbtdsZuIlQ4nPQ==’, signatures: [ { keyid: ‘SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA’, sig: ‘MEUCIE2UwWOiqF7h+/wy7couMhgLBPBNm3dMhi3qyVUt+MtjAiEAlMyO12Ros0SDJiQRteOCMr+mPm8mtDGDmAn662Nkzr4=’ } ] }, directories: {} } Done in 1.20s.

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

yarn create next-app --typescript followed by yarn dev

Describe the Bug

Following the instructions in the getting started docs should be a simple enough affair.

But on FreeBSD it doesn’t compile.

I do the automatic setup using yarn create next-app --typescript followed by yarn dev.

This throws an error

$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - SWC minify release candidate enabled. https://nextjs.link/swcmin
Error: Unsupported platform: freebsd
    at /usr/home/crm/new_app/my-app/node_modules/next/dist/lib/download-wasm-swc.js:84:31
    at Object.downloadWasmSwc (/usr/home/crm/new_app/my-app/node_modules/next/dist/lib/download-wasm-swc.js:98:7)
    at async /usr/home/crm/new_app/my-app/node_modules/next/dist/build/swc/index.js:114:13
Done in 3.22s.
$ 
)

I try also by disabling swcMinify in next.config.js. The Error is the same.

There were past issues about this and they were marked closed, so I assumed this would have been resolved by now.

Expected Behavior

yarn dev should succeed.

Link to reproduction

Just follow the instructions in the getting started guide.

To Reproduce

Just follow the instructions in the getting started guide.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
i-bsdcommented, Jul 24, 2022

This is a parcel issue.

Experiencing the same thing with Gatsby (our build machines all use FreeBSD so this is causing major headaches for us as we have to temporarily resort to low performance hypervisor builds). Can someone notify the relevant devs that FreeBSD still exists?

3reactions
toobrcommented, Jul 24, 2022

This error comes from node_modules/next/dist/lib/download-wasm-swc.js because the cache file location is not specified for FreeBSD. That’s easily solvable by adding something like else if (process.platform === "freebsd") { systemCacheDirectory = _path.default.join(_os.default.homedir(), ".cache"); in the block where cache directory locations are being set for Linux, Darwin, Windows.

After fixing this next dev actually starts to work.

next build though, breaks badly.

$ next build
info  - SWC minify release candidate enabled. https://nextjs.link/swcmin
info  - Linting and checking validity of types  
info  - Using experimental wasm build of next-swc
warn  - Attempted to load @next/swc-freebsd-x64, but an error occurred: /lib/libc.so.7: version FBSD_1.7 required by /usr/home/an/toobr/new_app/bugfix/node_modules/@next/swc-freebsd-x64/next-swc.freebsd-x64.node not found

panicked at 'The global thread pool has not been initialized.: ThreadPoolBuildError { kind: IOError(Error { kind: Unsupported, message: "operation not supported on this platform" }) }', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:170:10

Stack:

Error
    at module.exports.__wbg_new_693216e109162396 (/usr/home/an/toobr/new_app/bugfix/node_modules/next/wasm/@next/swc-wasm-nodejs/wasm.js:202:17)
    at wasm://wasm/05e8633a:wasm-function[6129]:0x11550b7
    at wasm://wasm/05e8633a:wasm-function[14808]:0x142e83b
    at wasm://wasm/05e8633a:wasm-function[11897]:0x13dbf20
    at wasm://wasm/05e8633a:wasm-function[12932]:0x140d499
    at wasm://wasm/05e8633a:wasm-function[13945]:0x14286cb
    at wasm://wasm/05e8633a:wasm-function[13327]:0x141ae89
    at wasm://wasm/05e8633a:wasm-function[11923]:0x13dd62e
    at wasm://wasm/05e8633a:wasm-function[1264]:0xa87abb
    at wasm://wasm/05e8633a:wasm-function[710]:0x81186b


info  - Creating an optimized production build  
Failed to compile.

static/chunks/framework-2e315a3383098fda.js from Terser
unreachable
RuntimeError: unreachable
    at wasm://wasm/05e8633a:wasm-function[11897]:0x13dbf43
    at wasm://wasm/05e8633a:wasm-function[12932]:0x140d499
    at wasm://wasm/05e8633a:wasm-function[13945]:0x14286cb
    at wasm://wasm/05e8633a:wasm-function[13327]:0x141ae89
    at wasm://wasm/05e8633a:wasm-function[11923]:0x13dd62e
    at wasm://wasm/05e8633a:wasm-function[1264]:0xa87abb
    at wasm://wasm/05e8633a:wasm-function[710]:0x81186b
    at wasm://wasm/05e8633a:wasm-function[710]:0x812511
    at wasm://wasm/05e8633a:wasm-function[3846]:0xf4b28f
    at wasm://wasm/05e8633a:wasm-function[710]:0x8116c7


> Build failed because of webpack errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The directory location mentioned in text of the panic message (pasting again below) indicates either a MacOS location is hard coded, or it is treating FreeBSD and MacOS identically.

panicked at 'The global thread pool has not been initialized.: ThreadPoolBuildError { kind: IOError(Error { kind: Unsupported, message: "operation not supported on this platform" }) }', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:170:10

This definitely needs a closer look.

Or perhaps, SWC won’t actually work here, so FreeBSD users should spare themselves the trouble and just use Babel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

freebsd Unsupported platform #1049 - puppeteer ... - GitHub
What steps will reproduce the problem? Please include code that reproduces the issue. $ npm install puppeteer. What is the expected result?
Read more >
Only platforms with Tier 1 support can be upgraded by freebsd ...
This may be because upgrading from this platform (amd64) or release (RELEASE-13.0) is unsupported by freebsd-update. Only platforms with ...
Read more >
How to fix 'Unsupported platform for fsevents@1.2.9: wanted ...
First,. Run your command prompt or powershell as Administrator role. Then you'll get avoided with PERMISSION ERROR . Second,. Ignore npm audit fix...
Read more >
Getting Started - ESBuild
Getting Started. #Install esbuild. First, download and install the esbuild command locally. A prebuilt native executable can be installed using npm (which ...
Read more >
pampapam2 - bkimminich/juice-shop - Gitter
(node:11052) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or ... npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found