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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parcel2 on arm/pi #33

Closed
koellcode opened this issue Sep 20, 2020 · 12 comments
Closed

Parcel2 on arm/pi #33

koellcode opened this issue Sep 20, 2020 · 12 comments

Comments

@koellcode
Copy link

馃悰 bug report

after succesful installing on arm i get a undefined symbol error in sourcemap.node

馃帥 Configuration (.babelrc, package.json, cli command)

just demo

cat package.json
{
"name": "parcel2-demo",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {},
"scripts": {
"start": "parcel serve ./src/index.html",
"build": "parcel build ./src/index.html"
},
"devDependencies": {
"parcel": "^2.0.0-beta.1"
}
}

馃 Expected Behavior

should build

馃槸 Current Behavior

doesn鈥榯 build, fails with:

$ parcel build ./src/index.html
internal/modules/cjs/loader.js:1127
return process.dlopen(module, path.toNamespacedPath(filename));
^

Error: /home/thomas/git/parcel2-demo/node_modules/@parcel/source-map/build/Release/sourcemap.node: undefined symbol: _ZN4Napi7details31needs_objectwrap_destructor_fixE
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1127:18)
at Module.load (internal/modules/cjs/loader.js:941:32)
at Function.Module._load (internal/modules/cjs/loader.js:782:14)
at Module.require (internal/modules/cjs/loader.js:965:19)
at require (internal/modules/cjs/helpers.js:88:18)
at load (/home/thomas/git/parcel2-demo/node_modules/node-gyp-build/index.js:21:10)
at Object. (/home/thomas/git/parcel2-demo/node_modules/@parcel/source-map/dist/node.js:14:43)
at Module._compile (internal/modules/cjs/loader.js:1076:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:941:32)
error Command failed with exit code 1.

馃拋 Possible Solution

馃敠 Context

i run code-server on a raspi4 and try some PoCs there sometimes, this time i wanted to try out parcel2

馃捇 Code Sample

馃實 Your Environment

Software Version(s)
Parcel 2.0.0 beta 1
Node 14.11.0
npm/Yarn yarn 1.22.5
Operating System Arch Linux ARM
@mischnic
Copy link
Member

Looks more like a Node bug, not sure if we can do anything about that

@koellcode
Copy link
Author

koellcode commented Sep 20, 2020

thx for the quick response :) fyi, i鈥榲e tried it now with nodejs 12.x and 13.x . Same issue there :/ (yarn cache clean, rm node_modules) this indeed does not eliminate the assumption thats a node bug.

greetings thomas

@mischnic
Copy link
Member

The code in node-addon-api using needs_objectwrap_destructor_fix exists only their version node-addon-api@2.X.X, not in version 3 which is what we're using in the sourcemap library.

https://github.com/nodejs/node-addon-api/blob/2.0.2/napi-inl.h#L23

@mischnic mischnic transferred this issue from parcel-bundler/parcel Sep 25, 2020
@WA9ACE

This comment has been minimized.

@mischnic

This comment has been minimized.

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Nov 25, 2020

Please continue the Mac M1 (Apple Silicon) conversation in #41

@mischnic
Copy link
Member

I don't get an error on an Raspberry Pi 1 B (armv6l) and parcel@nightly (with both serve and build), it's just unbearably slow 馃槃

@nathanielparry78
Copy link

Individually installing @parcel/source-map fixed this for me when running parcel@2.0.0-beta.1.

What I discovered was parcel@2.0.0-beta.1 uses an older version of @parcel/source-map that is running node-addon-api@2.X.X NOT v3 as indicated above. When I ran npm i @parcel/source-map it installed @parcel/source-map@2.0.0-alpha.4.20 which DOES have v3 of node-addon-api.

Hope this helps somebody.

@mischnic
Copy link
Member

mischnic commented Feb 3, 2021

So I guess we can close this because it's fixed when the latest version?

@nathanielparry78
Copy link

nathanielparry78 commented Feb 3, 2021

The fix is included in the nightly version, but not the beta version.

Maybe we could get parcel@2.0.0-beta.2 that includes this fix? :D

@Javarome
Copy link

Javarome commented Mar 30, 2021

Hello, I'm running into this problem too on a MacBook M1, but I fail to workaround it using your tip @nathanielparry78

I used:

  "devDependencies": {
    "@parcel/source-map": "^2.0.0-alpha.4.20",      // Your tip @nathanielparry78
    "@parcel/transformer-sass": "^2.0.0-alpha.3",   // I need this one, which prevents me to use parcel beta2 or nightly
    "@types/jest": "26.0.20",
    "identity-obj-proxy": "^3.0.0",
    "jest": "26.6.3",
    "parcel": "2.0.0-beta.1",
    "sass": "1.32.8"
  }

The error is:

node:internal/modules/cjs/loader:1151
return process.dlopen(module, path.toNamespacedPath(filename));
               ^

Error: dlopen(/Users/jerome/project/node_modules/@parcel/utils/node_modules/@parcel/source-map/build/Release/sourcemap.node, 1): Symbol not found: __ZN4Napi7details31needs_objectwrap_destructor_fixE
Referenced from: /Users/jerome/project/node_modules/@parcel/utils/node_modules/@parcel/source-map/build/Release/sourcemap.node
Expected in: flat namespace
in /Users/jerome/project/node_modules/@parcel/utils/node_modules/@parcel/source-map/build/Release/sourcemap.node
  at Object.Module._extensions..node (node:internal/modules/cjs/loader:1151:18)
  at Module.load (node:internal/modules/cjs/loader:972:32)
  at Function.Module._load (node:internal/modules/cjs/loader:813:14)
  at Module.require (node:internal/modules/cjs/loader:996:19)
  at require (node:internal/modules/cjs/helpers:92:18)
  at load (/Users/jerome/project/node_modules/node-gyp-build/index.js:21:10)
  at Object.<anonymous> (/Users/jerome/project/node_modules/@parcel/utils/node_modules/@parcel/source-map/dist/node.js:14:43)
  at Module._compile (node:internal/modules/cjs/loader:1092:14)
  at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
  at Module.load (node:internal/modules/cjs/loader:972:32) {
code: 'ERR_DLOPEN_FAILED'
}

Also, the node 15.12.0 executable is M1 compatible:

jerome@MacBookM1 project % which node                 
/opt/homebrew/bin/node
jerome@MacBookM1 project % file /opt/homebrew/bin/node
/opt/homebrew/bin/node: Mach-O 64-bit executable arm64

Is there something I'm missing?

@DeMoorJasper
Copy link
Member

Resolved by #52

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

6 participants