Yarn Build command fails
Qwik Version
0.10.0
Operating System (or Browser)
Debian Linux and MacOS
Node Version (if applicable)
No response
Which component is affected?
Qwik Runtime
Expected Behaviour
Running yarn build on a fork of the Qwik repo runs a complete build.
Actual Behaviour
It crashes during the yarn build.runtime step. yarn build.full seems to work, so maybe it's an issue with the binaries that are being pulled in from npm?
Additional Information
Log output here:
root@58fe9000ca0d:/workspaces/qwik# yarn build
(node:25123) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:25123) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, transformSource
🌎 Qwik v0.10.0-dev20221011014202 [node v17.9.0, linux/x64]
/workspaces/qwik/packages/qwik/dist
🐷 generated package.json
🦊 core.mjs: { original: '240.6kb', brotli: '42.9kb' }
🐨 build
🐮 jsx-runtime
🐭 core.min.mjs: { original: '52.3kb', brotli: '18kb' }
🦁 testing
🐸 qwikloader: { original: '1.8kb', brotli: '926b' }
📠 cli
🐹 optimizer
🐰 server
🦉 native binding / wasm (copied from npm v0.10.0)
vite v3.1.1 building for lib...
✓ 0 modules transformed.
❌ Error: Command failed with exit code 1: yarn build.runtime
[vite-plugin-qwik] invalid type: unit value, expected a boolean
error during build:
Error: invalid type: unit value, expected a boolean
at imports.wbg.__wbg_new_8d2af00bc1e329ee (file:///workspaces/qwik/packages/qwik/dist/bindings/qwik.wasm.mjs:368:21)
at <serde_wasm_bindgen::error::Error as serde::de::Error>::custom::hca6377403653907c (wasm://wasm/00b9054a:wasm-function[1655]:0x18f6b4)
at serde_wasm_bindgen::de::Deserializer::invalid_type_::hf460dc0e7cdbc2d7 (wasm://wasm/00b9054a:wasm-function[585]:0x138d1e)
at serde::de::MapAccess::next_value::h0a45ff36c04c753f (wasm://wasm/00b9054a:wasm-function[1501]:0x18749d)
at qwik_wasm::transform_modules::h236ab9dbff55b6a1 (wasm://wasm/00b9054a:wasm-function[63]:0x5ffed)
at transform_modules (wasm://wasm/00b9054a:wasm-function[3262]:0x1c1cc6)
at Module.transform_modules (file:///workspaces/qwik/packages/qwik/dist/bindings/qwik.wasm.mjs:197:14)
at transformFsAsync (file:///workspaces/qwik/packages/qwik/dist/optimizer.mjs:667:20)
at async Object.buildStart (file:///workspaces/qwik/packages/qwik/dist/optimizer.mjs:1028:22)
at async Object.buildStart (file:///workspaces/qwik/packages/qwik/dist/optimizer.mjs:1966:7)
at makeError (file:///workspaces/qwik/node_modules/execa/lib/error.js:59:11)
at handlePromise (file:///workspaces/qwik/node_modules/execa/index.js:119:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async buildRuntime (file:///workspaces/qwik/scripts/qwik-city.ts:87:18)
at async buildQwikCity (file:///workspaces/qwik/scripts/qwik-city.ts:25:3)
at async build (file:///workspaces/qwik/scripts/build.ts:76:7)
Error: Error: Command failed with exit code 1: yarn build.runtime
[vite-plugin-qwik] invalid type: unit value, expected a boolean
error during build:
Error: invalid type: unit value, expected a boolean
at imports.wbg.__wbg_new_8d2af00bc1e329ee (file:///workspaces/qwik/packages/qwik/dist/bindings/qwik.wasm.mjs:368:21)
at <serde_wasm_bindgen::error::Error as serde::de::Error>::custom::hca6377403653907c (wasm://wasm/00b9054a:wasm-function[1655]:0x18f6b4)
at serde_wasm_bindgen::de::Deserializer::invalid_type_::hf460dc0e7cdbc2d7 (wasm://wasm/00b9054a:wasm-function[585]:0x138d1e)
at serde::de::MapAccess::next_value::h0a45ff36c04c753f (wasm://wasm/00b9054a:wasm-function[1501]:0x18749d)
at qwik_wasm::transform_modules::h236ab9dbff55b6a1 (wasm://wasm/00b9054a:wasm-function[63]:0x5ffed)
at transform_modules (wasm://wasm/00b9054a:wasm-function[3262]:0x1c1cc6)
at Module.transform_modules (file:///workspaces/qwik/packages/qwik/dist/bindings/qwik.wasm.mjs:197:14)
at transformFsAsync (file:///workspaces/qwik/packages/qwik/dist/optimizer.mjs:667:20)
at async Object.buildStart (file:///workspaces/qwik/packages/qwik/dist/optimizer.mjs:1028:22)
at async Object.buildStart (file:///workspaces/qwik/packages/qwik/dist/optimizer.mjs:1966:7)
at makeError (file:///workspaces/qwik/node_modules/execa/lib/error.js:59:11)
at handlePromise (file:///workspaces/qwik/node_modules/execa/index.js:119:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async buildRuntime (file:///workspaces/qwik/scripts/qwik-city.ts:87:18)
at async buildQwikCity (file:///workspaces/qwik/scripts/qwik-city.ts:25:3)
at async build (file:///workspaces/qwik/scripts/build.ts:76:7)
at panic (file:///workspaces/qwik/scripts/util.ts:210:4)
at build (file:///workspaces/qwik/scripts/build.ts:100:5)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Hi Glenn 👋
Tried it on my MBP M1 as well on a fork of 🌎 Qwik v0.12.1-dev20221030202837 [node v17.9.0, linux/arm64] without an issue:
root@3e383f3965a3:/workspaces/qwik-fork# yarn build
(node:93585) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:93585) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, transformSource
🌎 Qwik v0.12.1-dev20221030202837 [node v17.9.0, linux/arm64]
/workspaces/qwik-fork/packages/qwik/dist
🐷 generated package.json
🐨 build
🐮 jsx-runtime
🦁 testing
🐸 qwikloader: { original: '1.8kb', brotli: '926b' }
📠 cli
🦊 core.mjs: { original: '244.7kb', brotli: '43.7kb' }
🐭 core.min.mjs: { original: '53.1kb', brotli: '18.3kb' }
🐰 server
🐹 optimizer
🦉 native binding / wasm (copied from npm v0.12.1)
vite v3.2.1 building for lib...
✓ 14 modules transformed.
../lib/index.qwik.mjs 16.52 KiB / gzip: 4.75 KiB
../lib/index.qwik.cjs 17.53 KiB / gzip: 4.99 KiB
🏙 qwik-city
🥶 submodule d.ts API files generated
Do you wanna try the latest version again or can i help you with any other info?
Thanks for the update @zanettin! :rocket:
@Oyemade @youngboy Have you tried building the Qwik repo lately? Is this still an issue for you?
@nnelgxorz Apologies for the delay, yarn build works but yarn install exits with an error
esbuild@npm:0.15.12 must be built because it never has been before or the last one failed ➤ YN0007: │ wasm-pack@npm:0.10.3 must be built because it never has been before or the last one failed ➤ YN0009: │ wasm-pack@npm:0.10.3 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-f8ea7061/build.log) ➤ YN0008: │ qwik-monorepo@workspace:. must be rebuilt because its dependency tree changed ➤ YN0000: └ Completed in 47s 331ms ➤ YN0000: Failed with errors in 55s 141ms
Thx @Oyemade 🙏
Retested it as well and yes it fails during yarn install also within the devcontainer.
log
# This file contains the result of Yarn building a package (wasm-pack@npm:0.10.3)
# Script name: postinstall
/workspaces/qwik-fork/node_modules/wasm-pack/binary.js:20
throw new Error(`Unsupported platform: ${type} ${arch}`);
^
Error: Unsupported platform: Linux arm64
at getPlatform (/workspaces/qwik-fork/node_modules/wasm-pack/binary.js:20:9)
at getBinary (/workspaces/qwik-fork/node_modules/wasm-pack/binary.js:24:20)
at install (/workspaces/qwik-fork/node_modules/wasm-pack/binary.js:38:18)
at Object.<anonymous> (/workspaces/qwik-fork/node_modules/wasm-pack/install.js:4:1)
at Module._compile (node:internal/modules/cjs/loader:1099:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Node.js v17.9.0
Issue seems to be related to this thread https://github.com/rustwasm/wasm-pack/issues/952.
To overcome it, I removed wasm-pack from the package.json file and added cargo install wasm-pack; to the Dockerfile within the .devcontainer directory.
After that change cmds like yarn build.wasm run through 👍
[INFO]: Checking for the Wasm target...
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
wasm packing took 27 minutes 🙈
This is not a fix proposal more a debug output! Thanks a lot for further inputs @manucorporat and team 🙏
Thanks @Oyemade! Looks like the issue is still present.
27 minutes seems a bit excessive. I think we just have to wait for wasm-pack to push a new version with the fix.
Lol @nnelgxorz My guess is that after the move to pnpm this issue is not relevant anymore
So I'm closing this for now but if it's still relevant, please re-open
Thanks!