-
Notifications
You must be signed in to change notification settings - Fork 190
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
Could not resolve lightningcss.linux-arm64-gnu.node in Docker with M1 #335
Comments
hmm seems like it should work based on the logic here https://github.com/parcel-bundler/lightningcss/blob/master/node/index.js. Can you log out |
Inside the container within node:
|
This looks like an issue with glibc versions in the base image of debian/node, which is unfortunate because 2.35 seems to only be in
Maybe we need to roll back to an earlier version of Parcel in Docker? |
Reading the code, I wondered if I could bypass the requirement on glibc 2.35 and use WASM, but it fails too (maybe I don't understand how it should work): CSS_TRANSFORMER_WASM=1 npm run build
> [email protected] build
> parcel build index.html
🚨 Build failed.
@parcel/transformer-css: Could not resolve module
"/app/node_modules/lightningcss/pkg" from
"/app/node_modules/lightningcss/node/index.js"
Error: Could not resolve module "/app/node_modules/lightningcss/pkg" from
"/app/node_modules/lightningcss/node/index.js"
at $0578d0f6e116167e$export$fb2a0b866a8162dc.resolve
(/app/node_modules/@parcel/package-manager/lib/index.js:4991:21)
at NodePackageManager.resolveSync
(/app/node_modules/@parcel/package-manager/lib/index.js:3510:42)
at NodePackageManager.requireSync
(/app/node_modules/@parcel/package-manager/lib/index.js:3352:34)
at Module.m.require
(/app/node_modules/@parcel/package-manager/lib/index.js:3366:25)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/app/node_modules/lightningcss/node/index.js:16:20)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js
(node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at NodePackageManager.load
(/app/node_modules/@parcel/package-manager/lib/index.js:3375:15) It looks like I need to use FROM node:16.18.1-alpine as builder
# Parcel build needs a few things to work on alpine
RUN apk add --update --no-cache g++ make python3 && ln -sf python3 /usr/bin/python
WORKDIR /app
COPY . .
RUN npm i
RUN npm run build
###################################################################################
FROM nginx
COPY --from=builder /app/dist/ /usr/share/nginx/html/ I wonder if this is a documentation issue that should be fixed somehow? Now that Parcel has a dependency on the OS's C Library, you need to know what you're using and match it. This won't be obvious to lots of people. |
hmm I don't think we have a strong dependency on that. what version of Parcel are you upgrading from? might just be an artifact of how the binary was compiled. I'll have to look into it more |
That's great, thanks as always, @devongovett! At least I have a work around until you do. |
I am currently unable to run Maybe Ref: npm/cli#4828 ? |
I was able to resolve this error..... very weird.... Reproduction Steps:
I discovered that when running Can anyone shed light on this? Is this standard behavior? |
In GitHub Actions, |
Running I couldn't see the platform files in the I had to copy the files from the node_modules folder
Docker file:
|
This issue occurs without anything fancy, just Console output (Node.js v18.12.0)
|
I believe this was caused by an upstream commit to the base docker image we use to compile the ARM binaries, where Ubuntu was upgraded thereby causing GLIBC to be upgraded. I'm going to pin to an older version for now. |
@CristhianF7 your issue is with a different module (parcel-swc). Also looks like maybe you are on an even older version of Ubuntu (maybe 18?). We compile on Ubuntu 20.04. You could try upgrading. |
What? - Parcel start/build fails with error: ``` @parcel/transformer-css: Could not resolve module "/workspaces/samsaadhanii-concordance/node_modules/lightningcss/lightningcss.linux-arm64-gnu.node" from "/workspaces/samsaadhanii-concordance/node_modules/lightningcss/node/index.js" ``` - Guess it's most likely due to using linux docker image in macos (arm). - Adding `lightningcss` explicity as dep resolves this error. More details on this: parcel-bundler/lightningcss#335
Fails on ubuntu latest |
I'm not sure if this belongs in Parcel or here, but I'll start here and you can correct me.
It seems like trying to use
lightningcss
inside Docker on an M1 Mac fails to do the right thing with the binary dependencies (not sure if M1 is related or not, but that's what I'm using). I've made a demo repo to show the problem.If I do
npm run build
natively on my M1 Mac, it works. However, inside Docker, the build gives this:Inside the container, I can see that it's pulled in what I think are the right dependencies:
/app/node_modules# ls lightningcss* lightningcss: LICENSE README.md node package.json lightningcss-linux-arm64-gnu: README.md lightningcss.linux-arm64-gnu.node package.json lightningcss-linux-arm64-musl: README.md lightningcss.linux-arm64-musl.node package.json
Inside the container, node is using
process.platform === 'linux'
andprocess.arch === 'arm64'
.The text was updated successfully, but these errors were encountered: