Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workerd fails to run under OpenBSD-current; the afected dependency is install.js #1200

Open
celerafx opened this issue Jan 29, 2025 · 6 comments

Comments

@celerafx
Copy link

celerafx commented Jan 29, 2025

Running OpenBSD-CURRENT with LATEST NODE and suggested pnpm already. Failed to install dependencies; root cause to be workerd:

doas node install.js
doas (idurando@marsbsd-lab01) password:
node:internal/modules/cjs/loader:1247
throw err;
^
Error: Cannot find module '/home/idurando/noveltygen/install.js'
at Function._resolveFilename (node:internal/modules/cjs/loader:1244:15)
at Function._load (node:internal/modules/cjs/loader:1070:27)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
at node:internal/main/run_main_module:36:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v22.13.1


The error message indicates that the workerd package does not support the OpenBSD platform. Specifically, the pkgAndSubpathForCurrentPlatform function in the install.js script of the workerd package is throwing an error because it cannot find a precompiled binary for OpenBSD x64 LE (Little Endian). This is a common issue when using Node.js packages that rely on platform-specific native binaries.
Known Information:
Operating System : OpenBSD 7.6.
Node.js Version : v22.13.1.
Package Manager : pnpm.
Error Source : The workerd package's postinstall script fails because it does not have a precompiled binary for OpenBSD.
Repository : You are trying to build the waku repository from GitHub.
Root Cause:
The workerd package is designed to work with specific platforms (e.g., Linux, macOS, Windows) and architectures (e.g., x64). OpenBSD is not officially supported by the package, so the postinstall script fails when it attempts to determine the platform and load the appropriate binary.

@dai-shi
Copy link
Owner

dai-shi commented Jan 29, 2025

Is it about developing waku itself?

Can you try this please?

npm create waku@latest

@celerafx
Copy link
Author

marsbsd-lab01$ npm create waku@latest
Need to install the following packages:
[email protected]
Ok to proceed? (y) y

npx
create-waku

✔ Project Name … noveltygen
✔ waku-project is not empty. Remove existing files and continue? … yes
Setting up project...

Installing dependencies by running npm install...
marsbsd-lab01$ npm create waku@latest
Need to install the following packages:
[email protected]
Ok to proceed? (y) y

npx
create-waku

✔ Project Name … noveltygen
✔ waku-project is not empty. Remove existing files and continue? … yes
Setting up project...

Installing dependencies by running npm install...

added 252 packages, and audited 253 packages in 6m

47 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

Done. Now run:

cd noveltygen
npm run dev

marsbsd-lab01$ cd noveltygen
marsbsd-lab01$ npm run dev

[email protected] dev
waku dev

/home/idurando/noveltygen/node_modules/rollup/dist/native.js:89
throw new Error(
^

Error: Your current platform "openbsd" and architecture "x64" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead.

The following platform-architecture combinations are supported:
android-arm
android-arm64
darwin-arm64
darwin-x64
freebsd-arm64
freebsd-x64
linux-arm
linux-arm (musl)
linux-arm64
linux-arm64 (musl)
linux-loong64
linux-ppc64
linux-riscv64
linux-s390x
linux-x64
linux-x64 (musl)
win32-arm64
win32-ia32
win32-x64

If this is important to you, please consider supporting Rollup to make a native build for your platform and architecture available.
at throwUnsupportedError (/home/idurando/noveltygen/node_modules/rollup/dist/native.js:89:8)
at getPackageBase (/home/idurando/noveltygen/node_modules/rollup/dist/native.js:80:3)
at Object. (/home/idurando/noveltygen/node_modules/rollup/dist/native.js:42:21)
at Module._compile (node:internal/modules/cjs/loader:1562:14)
at Object..js (node:internal/modules/cjs/loader:1699:10)
at Module.load (node:internal/modules/cjs/loader:1313:32)
at Function._load (node:internal/modules/cjs/loader:1123:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at cjsLoader (node:internal/modules/esm/translators:263:5)

Node.js v22.13.1

marsbsd-lab01$

@dai-shi
Copy link
Owner

dai-shi commented Jan 30, 2025

Thanks! Can you also try

npm create vite@latest

and select React+TypeScript+SWC?

If it works, there's a hope.

@celerafx
Copy link
Author

celerafx commented Jan 30, 2025

marsbsd-lab01$ doas npm create vite@latest
doas (idurando@marsbsd-lab01) password:
Need to install the following packages:
[email protected]
Ok to proceed? (y) y

[email protected] npx
create-vite

✔ Project name: … noveltygen
✔ Select a framework: › React
✔ Select a variant: › TypeScript + SWC

Scaffolding project in /home/idurando/noveltygen/noveltygen...

Done. Now run:

cd noveltygen
npm install
npm run dev

marsbsd-lab01$ cd noveltygen
marsbsd-lab01$ doas npm install

added 140 packages, and audited 141 packages in 2m

40 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
marsbsd-lab01$ doas npm run dev

[email protected] dev
vite

/home/idurando/noveltygen/noveltygen/node_modules/rollup/dist/native.js:89
throw new Error(
^

Error: Your current platform "openbsd" and architecture "x64" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead.

The following platform-architecture combinations are supported:
android-arm
android-arm64
darwin-arm64
darwin-x64
freebsd-arm64
freebsd-x64
linux-arm
linux-arm (musl)
linux-arm64
linux-arm64 (musl)
linux-loong64
linux-ppc64
linux-riscv64
linux-s390x
linux-x64
linux-x64 (musl)
win32-arm64
win32-ia32
win32-x64

If this is important to you, please consider supporting Rollup to make a native build for your platform and architecture available.
at throwUnsupportedError (/home/idurando/noveltygen/noveltygen/node_modules/rollup/dist/native.js:89:8)
at getPackageBase (/home/idurando/noveltygen/noveltygen/node_modules/rollup/dist/native.js:80:3)
at Object. (/home/idurando/noveltygen/noveltygen/node_modules/rollup/dist/native.js:42:21)
at Module._compile (node:internal/modules/cjs/loader:1562:14)
at Object..js (node:internal/modules/cjs/loader:1699:10)
at Module.load (node:internal/modules/cjs/loader:1313:32)
at Function._load (node:internal/modules/cjs/loader:1123:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at cjsLoader (node:internal/modules/esm/translators:263:5)

Node.js v22.13.1
marsbsd-lab01$

@dai-shi
Copy link
Owner

dai-shi commented Jan 30, 2025

Thanks for confirming. I assume that the rollup issue is upstream. If upstream fixes it, Waku should follow.

The issue with @cloudflare/workerd is Waku specific, but it's for the development of Waku itself. I'm not sure if there's a canonical fix, but you can remove the dependency locally.

@rmarscher
Copy link
Contributor

My hope was that workerd compatibility wouldn't cause problems unless you are trying to run the cloudflare example.

I found a workaround in the nuxt repo that uses package manager overrides to switch to @rollup/wasm-node. Maybe one of those suggestions could work. nuxt/nuxt#24490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants