镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Error: Cannot load native addon because loading addons is disabled #1855

Open
parcel-bundler/parcel
#8630

Description

@ahaoboy

Description of Bug

Provide a concise description of your bug and your project link (if applicable).
https://stackblitz.com/edit/github-jn7xvb?file=index.js

npm run dev

❯ npm run dev
$ node ./index.js
Error: Cannot load native addon because loading addons is disabled.
    at async ESMLoader.import (https://github-jn7xvb.w.staticblitz.com/blitz.be57dda01bcfe1c4973d7980b1ec44aabd3a6863.js:6:1208899)
    at async i.loadESM (https://github-jn7xvb.w.staticblitz.com/blitz.be57dda01bcfe1c4973d7980b1ec44aabd3a6863.js:6:246545)
    at async handleMainPromise (https://github-jn7xvb.w.staticblitz.com/blitz.be57dda01bcfe1c4973d7980b1ec44aabd3a6863.js:6:988909) {
  code: 'ERR_DLOPEN_DISABLED'
}

Steps to Reproduce

In this project run cmd npm run dev
https://stackblitz.com/edit/github-jn7xvb?file=index.js

Expected Behavior

A clear and concise description of what you expected to happen.
Can run correctly

Screenshots/Screencast

If applicable, add screenshots to help explain your problem.
image

Additional Context/Questions
Add any other context or questions regarding this bug.

Activity

  1. NyllRE commented on Jul 22, 2022

    @NyllRE

    is there any available work arounds to this issue?

  2. ahaoboy commented on Nov 22, 2022

    @ahaoboy
    Author

    is there any available work arounds to this issue?

    Use this version "@parcel/graph": "2.8.1-nightly.2828"
    https://stackblitz.com/edit/github-jn7xvb-xjujsj?file=package.json,index.js

  3. 2color commented on Mar 10, 2023

    @2color

    I'm also experiencing this with Next.js 13

    https://stackblitz.com/github/2color/js-libp2p-transports-example?file=packages/nextjs/package.json

    ~/projects/aonipgpzp.github/packages/nextjs
    ❯ npm run dev
    $ next dev
    ready - started server on 0.0.0.0:3000, url: http://localhost:3000
    info  - Downloading WASM swc package...
    warning package.json: No license field
    info  - Using wasm build of next-swc
    warn  - Attempted to load @next/swc-linux-x64-gnu, but an error occurred: Cannot load native addon because loading addons is disabled: /home/projects/aonipgpzp.github/node_modules/@next/swc-linux-x64-gnu/next-swc.linux-x64-gnu.node
    warn  - Attempted to load @next/swc-linux-x64-gnux32, but it was not installed
    warn  - Attempted to load @next/swc-linux-x64-musl, but an error occurred: Cannot load native addon because loading addons is disabled: /home/projects/aonipgpzp.github/node_modules/@next/swc-linux-x64-musl/next-swc.linux-x64-musl.node
    event - compiled client and server successfully in 2.5s (703 modules)
    wait  - compiling / (client and server)...
    event - compiled client and server successfully in 763 ms (1408 modules)
    error - Error: Cannot load native addon because loading addons is disabled: /home/projects/aonipgpzp.github/node_modules/classic-level/prebuilds/linux-x64/node.napi.glibc.node
        at process.dlopen (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:15:113672)
        at Module._extensions..node (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:220122)
        at Module.load (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:217770)
        at Module._load (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:215341)
        at Module.require (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:218088)
        at i (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:419512)
        at _0xd5330f (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:15:143696)
        at load (file:///home/projects/aonipgpzp.github/node_modules/node-gyp-build/node-gyp-build.js:22:10)
        at Object.eval (file:///home/projects/aonipgpzp.github/node_modules/classic-level/binding.js:1:118)
        at Object.function (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:15:144430)
        at Module._compile (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:219080)
        at Module._extensions..js (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:219744)
        at Module.load (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:217770)
        at Module._load (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:215341)
        at Module.require (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:218088)
        at i (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:419512)
        at _0xd5330f (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:15:143696)
        at Object.eval (file:///home/projects/aonipgpzp.github/node_modules/classic-level/index.js:7:17)
        at Object.function (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:15:144430)
        at Module._compile (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:219080)
        at Module._extensions..js (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:219744)
        at Module.load (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:217770)
        at Module._load (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:215341)
        at Module.require (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:218088)
        at i (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:419512)
        at _0xd5330f (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:15:143696)
        at Object.eval (file:///home/projects/aonipgpzp.github/node_modules/level/index.js:1:92)
        at Object.function (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:15:144430)
        at Module._compile (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:219080)
        at Module._extensions..js (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:219744)
        at Module.load (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:217770)
        at Module._load (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:215341)
        at _0x41eea6.executionFunctionOrLineOffset (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:983543)
        at _0x41eea6._evaluate (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:15:306511)
        at _0x41eea6._evaluate (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:15:306631)
        at async ModuleJob.run (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:987429)
        at async Promise.all (index 0)
        at async ESMLoader.import (https://aonipgpzpgithub-rra1.w-credentialless.staticblitz.com/blitz.9bdac2de468a4854f7bacb85c771c93d5676829b.js:6:1209138) {
      code: 'ERR_DLOPEN_DISABLED',
      page: '/'
    }
    
  4. pumano commented on Apr 7, 2023

    @pumano

    Cannot load native addon because loading addons is disabled: /home/projects/github-aocna8/node_modules/@nrwl/nx-linux-x64-musl/nx.linux-x64-musl.node

    nx not working

  5. aperepel commented on May 11, 2023

    @aperepel

    Next.JS 13.4.1 fails to start, as it can't load native SWC add on. Bummer

  6. maxch-aa commented on May 15, 2023

    @maxch-aa
  7. bitsnaps commented on Oct 12, 2023

    @bitsnaps

    I'm having the same issue with Next v13:

    ⚠ Attempted to load @next/swc-linux-x64-gnu, but an error occurred: Cannot load native addon because loading addons is disabled: /home/projects/stackblitz-starters-xnukbg/node_modules/@next/swc-linux-x64-gnu/next-swc.linux-x64-gnu.node
     ⚠ Attempted to load @next/swc-linux-x64-musl, but an error occurred: Cannot load native addon because loading addons is disabled: /home/projects/stackblitz-starters-xnukbg/node_modules/@next/swc-linux-x64-musl/next-swc.linux-x64-musl.node
     X Failed to load SWC binary for linux/x64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
    
  8. volkan0x commented on Nov 24, 2023

    @volkan0x

    i'm having the same issue on stackblitz

  9. XantreDev commented on Dec 23, 2023

    @XantreDev
  10. ulrischa commented on Jun 7, 2024

    @ulrischa

    Same here. First: npx create-next-app@latest --typescript --use-npm
    Then npm run dev
    Can I not run a simple next.js App?

  11. empz commented on Jul 2, 2024

    @empz

    Still getting this issue on a Next.js 14 app. Please Stackblitz team, provide a solution. It's only the most popular React-based framework we're talking about here.

  12. Th3R1c0 commented on Jul 9, 2024

    @Th3R1c0

    im getting this issue as well, a quick bypass is just to downgrade nextjs versions to "next": "13.5.1" instead of the latest one, and it seems to work as a temporary bybass by allowing the nextjs to still run, but the error is still present.

  13. candidia commented on Sep 25, 2024

    @candidia
  14. eldados commented on Oct 9, 2024

    @eldados

    got the same issue with nextjs 14, is there a fix?

  15. sequba commented on Jan 15, 2025

    @sequba

    I had the same issue with JS project using parcel. I switched to vite and it works fine.

  16. oceangravity commented on Feb 27, 2025

    @oceangravity

    This affects tailwind v4 https://stackblitz.com/edit/remix-run-remix-kfshfc?file=app%2Froot.tsx

    Unfortunately, I can confirm that this issue is currently occurring with Tailwind 4.

    😢

  17. tsotimus commented on Feb 28, 2025

    @tsotimus

    Want to confirm that this is effecting tailwind v4 - I was using vite 6.0+

  18. CypherpunkSamurai commented on Mar 4, 2025

    @CypherpunkSamurai

    I want to report that this issue occurs when cold booting the web container, when we have a running container and we install tailwind it works fine.

  19. razzededge commented on Mar 22, 2025

    @razzededge

    a bummer, tailwind 4 cannot be run

  20. ShayokhShorfuddin commented on Apr 7, 2025

    @ShayokhShorfuddin

    Tailwind v4 doesn't work.

  21. Gold240sx commented on Apr 10, 2025

    @Gold240sx

    I'm confirming this now but sections of Tailwind as well as parts if not all of Next.js's Turbopack is written in rust I believe, and because Rust is not a native language on the browser, like Javascript is, that's why these errors persist. The errors should be avoidable with a v3.x.x version of tailwind and just remove the --turbopack flag from the npm run dev script in your package.json... and that does seem like it.

    I created a working and compatible Next.js / Tailwind / GSAP / ShadCn / React-Hook-Form / Typescript / Zod template y'all can build off of.

    NextBlitz

    And the package.json that worked for my stackblitz setup was:

    {
      "name": "signature-trace-next",
      "version": "0.1.0",
      "private": true,
      "scripts": {
        "dev": "next dev",
        "build": "next build",
        "start": "next start",
        "lint": "next lint"
      },
      "dependencies": {
        "@gsap/react": "^2.1.2",
        "@radix-ui/react-slot": "^1.2.0",
        "class-variance-authority": "^0.7.1",
        "clsx": "^2.1.1",
        "gsap": "^3.12.7",
        "gsap-trial": "^3.12.7",
        "lucide-react": "^0.487.0",
        "next": "15.2.5",
        "react": "^19.0.0",
        "react-dom": "^19.0.0",
        "tailwind-merge": "^3.2.0",
        "tailwindcss-animate": "^1.0.7",
        "zod": "^3.24.2"
      },
      "devDependencies": {
        "@types/node": "^20",
        "@types/react": "^19",
        "@types/react-dom": "^19",
        "autoprefixer": "^10.4.19",
        "postcss": "^8.4.38",
        "tailwindcss": "^3.3.3",
        "typescript": "^5"
      }
    }

    If you're configuring off of a fresh next.js setup, you have to remove the "@tailwindcss/postcss" from your package.json since that's tailwind 4 only. Also, update your postcss.config.mjs to

    module.exports = {
      plugins: {
        tailwindcss: {},
        autoprefixer: {},
        '@tailwindcss/postcss': {}, // optional: only include this if you're using it directly
      },
    }

    and these 3 are the main items that need to match each other:

    "tailwindcss": "^3.4.1", // or whatever 3.x you want
    "postcss": "^8.4.38",
    "autoprefixer": "^10.4.19"
  22. messenjer commented on Apr 14, 2025

    @messenjer

    The new version of tailwind v4.1.4 :

    Add experimental @tailwindcss/oxide-wasm32-wasi target for running Tailwind in browser environments like StackBlitz (tailwindlabs/tailwindcss#17558)

  23. mrruby commented on Apr 15, 2025

    @mrruby

    The new version of tailwind v4.1.4 :

    Add experimental @tailwindcss/oxide-wasm32-wasi target for running Tailwind in browser environments like StackBlitz (tailwindlabs/tailwindcss#17558)

    failed to load config from /home/mrruby/omniston-swap-app/vite.config.js
    error when starting dev server:
    Error: Failed to load native binding
        at Object.eval (/home/mrruby/omniston-swap-app/node_modules/.pnpm/@tailwindcss+oxide@4.1.4/node_modules/@tailwindcss/oxide/index.js:372:11)
        at Object._0x29adb5 (https://omnistonswapapp-feoj.w-credentialless-staticblitz.com/blitz.fb22cd3d.js:31:872335)
        at Module._compile (node:internal/modules/cjs/loader:148:16006)
        at Module._extensions..js (node:internal/modules/cjs/loader:148:16726)
        at Module.load (node:internal/modules/cjs/loader:148:15281)
        at Module._load (node:internal/modules/cjs/loader:148:12773)
        at G.set.n (node:internal/modules/esm/translators:163:4437)
        at _0x11b6bc.evaluationFunction (node:internal/modules/esm/translators:163:3218)
        at _0x11b6bc.evaluate (https://omnistonswapapp-feoj.w-credentialless-staticblitz.com/blitz.fb22cd3d.js:31:838804)
        at _0x56cb89._evaluate (https://omnistonswapapp-feoj.w-credentialless-staticblitz.com/blitz.fb22cd3d.js:31:846088)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions