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

@parcel/optimizer-swc: Bindings not found #9844

Open
dagnelies-elo opened this issue Jul 11, 2024 · 3 comments
Open

@parcel/optimizer-swc: Bindings not found #9844

dagnelies-elo opened this issue Jul 11, 2024 · 3 comments

Comments

@dagnelies-elo
Copy link

dagnelies-elo commented Jul 11, 2024

🐛 bug report

Fails to build with parcel build --no-cache --public-url ./ src/*.html

🚨 Build failed.
@parcel/optimizer-swc: Bindings not found.
  Error: Bindings not found.
      at Compiler.<anonymous> 
  (/builds/.../node_modules/@swc/core/index.js:227:19)
      at Generator.next (<anonymous>)
      at /builds/.../node_modules/@swc/core/index.js:31:71
      at new Promise (<anonymous>)
      at __awaiter 
  (/builds/.../node_modules/@swc/core/index.js:27:12)
      at Compiler.transform 
  (/builds/.../node_modules/@swc/core/index.js:203:16)
      at transform 
  (/builds/.../node_modules/@swc/core/index.js:352:21)
      at Object.optimize 
  (/builds/.../node_modules/@parcel/optimizer-swc/lib/SwcOptimizer.js:84:44)
      at process.processTicksAndRejections 
  (node:internal/process/task_queues:95:5)
      at async PackagerRunner.optimize 
  (/builds/.../node_modules/@parcel/core/lib/PackagerRunner.js:342:20)

🎛 Configuration (.babelrc, package.json, cli command)

Running on node 22, nothing fancy in the package.json:

"devDependencies": {
    "@parcel/transformer-vue": "^2.12.0",
    "parcel": "^2.12.0"
  },
  "scripts": {
    "build": "parcel build --no-cache --public-url ./ src/*.html",
  },
  "dependencies": {
    ...
    "vue": "^3.4.31"
  },
  "optionalDependencies": {
    "@parcel/watcher-linux-x64-glibc": "^2.4.2-alpha.0"
  }

The optional dependency was needed, otherwise it would result in another bug reported here.

And the typescript config looks as follows:

{
  "compilerOptions": {
    "lib": [
      "dom",
      "es2016"
    ]
  }
}

🤔 Expected Behavior

It compiles

😯 Current Behavior

It throws that error

💁 Possible Solution

🔦 Context

💻 Code Sample

🌍 Your Environment

Software Version(s)
Parcel 2.12.0
Node 22
npm/Yarn npm
Operating System Linux

...but it works on Windows!

@dagnelies-elo
Copy link
Author

After a lot of difficult search, the following workaround seems to do the trick:

npm install -O @swc/core-linux-x64-glibc
npm install -O @swc/core-linux-x64-gnu

@isitgeorge
Copy link

isitgeorge commented Jul 24, 2024

After a lot of difficult search, the following workaround seems to do the trick:

npm install -O @swc/core-linux-x64-glibc
npm install -O @swc/core-linux-x64-gnu

@dagnelies-elo Had this issue when building Parcel on a DigitalOcean App Platform instance, this fixed it. Any idea why these dependencies aren't automatically installed if required?

@dagnelies-elo
Copy link
Author

...sorry ...I have no clue about the logic behind these optional dependencies

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

2 participants