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 fails to build on NixOS 23.11 channel #278462

Closed
hariroshan opened this issue Jan 3, 2024 · 1 comment
Closed

Parcel fails to build on NixOS 23.11 channel #278462

hariroshan opened this issue Jan 3, 2024 · 1 comment

Comments

@hariroshan
Copy link

hariroshan commented Jan 3, 2024

Describe the bug

When I run the parcel cli, I get this error.

Error: Got unexpected undefined
    at nullthrows (/nix/store/fjzb8khvq7qa7dhvwrp8j8vzf81gmjdg-parcel-2.10.2/lib/node_modules/parcel/node_modules/nullthrows/nullthrows.js:7:15)
    at Object.<anonymous> (/nix/store/fjzb8khvq7qa7dhvwrp8j8vzf81gmjdg-parcel-2.10.2/lib/node_modules/parcel/node_modules/@parcel/node-resolver-core/lib/builtins.js:67:38)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/nix/store/fjzb8khvq7qa7dhvwrp8j8vzf81gmjdg-parcel-2.10.2/lib/node_modules/parcel/node_modules/@parcel/node-resolver-core/lib/Wrapper.js:21:41)
    at Module._compile (node:internal/modules/cjs/loader:1256:14) {
  framesToPop: 1
}

Steps To Reproduce

Steps to reproduce the behavior:

Using the nixos-23.11 hash from status.nixos.com

$ nix-shell -p 'nodePackages.parcel' -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/32f63574c85fbc80e4ba1fbb932cde9619bad25e.tar.gz

$ parcel --version
2.10.2

$ parcel serve # doesn't matter whether it is build or serve

Error: Got unexpected undefined
    at nullthrows (/nix/store/fjzb8khvq7qa7dhvwrp8j8vzf81gmjdg-parcel-2.10.2/lib/node_modules/parcel/node_modules/nullthrows/nullthrows.js:7:15)
    at Object.<anonymous> (/nix/store/fjzb8khvq7qa7dhvwrp8j8vzf81gmjdg-parcel-2.10.2/lib/node_modules/parcel/node_modules/@parcel/node-resolver-core/lib/builtins.js:67:38)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/nix/store/fjzb8khvq7qa7dhvwrp8j8vzf81gmjdg-parcel-2.10.2/lib/node_modules/parcel/node_modules/@parcel/node-resolver-core/lib/Wrapper.js:21:41)
    at Module._compile (node:internal/modules/cjs/loader:1256:14) {
  framesToPop: 1
}

Expected behavior

Able to successfully build the HTML or serve

Metadata

$ nix-shell -p nix-info --run "nix-info -m"
this path will be fetched (0.00 MiB download, 0.00 MiB unpacked):
  /nix/store/a2mfyh90szmc055ivfnv182b5a4naq90-nix-info
copying path '/nix/store/a2mfyh90szmc055ivfnv182b5a4naq90-nix-info' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.0-169-generic, Ubuntu, 20.04.5 LTS (Focal Fossa), nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.1`
 - channels(root): `"nixpkgs-22.05"`
 - nixpkgs: `/nix/store/nkhjmzkf9hky9h34yrfy0cgyd9pbh03v-source`
@hariroshan
Copy link
Author

I'm leaving the answer here for webpack, but it applies to all the node packages.
If you are using node2nix, check if it prints the following or similar logs

WARNING: cannot pinpoint dependency: @swc/core-darwin-x64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/@swc/core
WARNING: cannot pinpoint dependency: @swc/core-win32-x64-msvc, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/@swc/core
WARNING: cannot pinpoint dependency: @swc/core-linux-x64-gnu, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/@swc/core
WARNING: cannot pinpoint dependency: @swc/core-linux-x64-musl, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/@swc/core
WARNING: cannot pinpoint dependency: @swc/core-win32-ia32-msvc, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/@swc/core
WARNING: cannot pinpoint dependency: @swc/core-linux-arm-gnueabihf, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/@swc/core
WARNING: cannot pinpoint dependency: @swc/core-linux-arm64-gnu, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/@swc/core
WARNING: cannot pinpoint dependency: @swc/core-darwin-arm64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/@swc/core
WARNING: cannot pinpoint dependency: @swc/core-linux-arm64-musl, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/@swc/core
WARNING: cannot pinpoint dependency: @swc/core-win32-arm64-msvc, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/@swc/core
WARNING: cannot pinpoint dependency: @pkgjs/parseargs, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/jackspeak
WARNING: cannot pinpoint dependency: lightningcss-darwin-x64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/lightningcss
WARNING: cannot pinpoint dependency: lightningcss-linux-x64-gnu, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/lightningcss
WARNING: cannot pinpoint dependency: lightningcss-win32-x64-msvc, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/lightningcss
WARNING: cannot pinpoint dependency: lightningcss-darwin-arm64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/lightningcss
WARNING: cannot pinpoint dependency: lightningcss-linux-arm64-gnu, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/lightningcss
WARNING: cannot pinpoint dependency: lightningcss-linux-arm-gnueabihf, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/lightningcss
WARNING: cannot pinpoint dependency: lightningcss-linux-arm64-musl, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/lightningcss
WARNING: cannot pinpoint dependency: lightningcss-linux-x64-musl, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/lightningcss
WARNING: cannot pinpoint dependency: lightningcss-freebsd-x64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/lightningcss
WARNING: cannot pinpoint dependency: @img/sharp-darwin-arm64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-darwin-x64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-libvips-darwin-arm64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-libvips-darwin-x64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-libvips-linux-arm, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-libvips-linux-arm64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-libvips-linux-s390x, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-libvips-linux-x64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-libvips-linuxmusl-arm64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-libvips-linuxmusl-x64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-linux-arm, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-linux-arm64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-linux-s390x, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-linux-x64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-linuxmusl-arm64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-linuxmusl-x64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-wasm32, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-win32-ia32, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp
WARNING: cannot pinpoint dependency: @img/sharp-win32-x64, context: /nix/store/rs4icancqvmxmapymbpy4wqhq9c2jcyb-node-dependencies-chatstrike-1.0.0/chatstrike/node_modules/sharp

This means it couldn't find the correct version on the package. To solve this, look for optionalDependencies in the package-lock.json, copy the correct versions of the packages to the package.json and run node2nix.

Ensure such warnings never occur while nix is building.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant