esbuild: Wasm build doesn't work on Windows

Running a build on Windows doesn’t work when using the esbuild-wasm package. It works fine when using esbuild (but we’d prefer to avoid that since it requires a postinstall script).

Repro:

git clone git@github.com:yarnpkg/berry && cd berry
git checkout mael/esbuild-2
yarn build:cli

Error:

error: Invalid path: C:\berry\packages\yarnpkg-cli\bundles\yarn.js
    at failureErrorWithLog (C:\berry\.yarn\cache\esbuild-wasm-npm-0.8.33-0589ac914f-8d0542a70c.zip\node_modules\esbuild-wasm\lib\main.js:969:15)
    at buildResponseToResult (C:\berry\.yarn\cache\esbuild-wasm-npm-0.8.33-0589ac914f-8d0542a70c.zip\node_modules\esbuild-wasm\lib\main.js:767:32)
    at C:\berry\.yarn\cache\esbuild-wasm-npm-0.8.33-0589ac914f-8d0542a70c.zip\node_modules\esbuild-wasm\lib\main.js:819:20
    at handleIncomingPacket (C:\berry\.yarn\cache\esbuild-wasm-npm-0.8.33-0589ac914f-8d0542a70c.zip\node_modules\esbuild-wasm\lib\main.js:566:9)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 25 (17 by maintainers)

Commits related to this issue

Most upvoted comments

https://github.com/nodejs/node/issues/36616#issuecomment-757929741 mentioned:

It took ~11 seconds for process.exit() to be honoured.

After reviewing 9ea2076 I can report that npm/esbuild-wasm/exit0/darwin-x64-LE.node works correctly on mac OS 10.9. The prebuilt zero dependency wasm-napi-exit0 dynamic libraries are a good workaround.