Closed simeoncarstens closed 1 year ago
I confirmed that temporarily changing the nixpkgs input in the flake from nixpkgs/release-22.11
to nixpkgs/21.11
allows the dev server to startup without that error. This gives us Node.js v14.18.1:
$ which node
/nix/store/p27ckm6j4i1g4v5k16rqc0xhp167ympw-nodejs-14.18.1/bin/node
Currently, we specify the nodejs
package which resolves to nodejs v18.14.1 in the development shell:
$ node --version
v18.14.1
$ which node
/nix/store/dkg6bp11b6zizjk4105582n8crjprmrz-nodejs-18.14.1/bin/node
It would therefore seem possible to use our current nixpkgs pin, but to specify Node v14 (instead of Node v18 which is the default). So, I updated the package from nodejs
to nodejs-14_x
. This gives us Node v14.21.3:
$ node --version
v14.21.3
Unfortunately, this fails with the same error as above:
$ ./run_dev_client.sh
yarn run v1.22.19
$ next dev
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/parser' is not defined by "exports" in /home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/node_modules/postcss/package.json
at new NodeError (node:internal/errors:399:5)
at exportsNotFound (node:internal/modules/esm/resolve:361:10)
at packageExportsResolve (node:internal/modules/esm/resolve:697:9)
at resolveExports (node:internal/modules/cjs/loader:565:36)
at Module._findPath (node:internal/modules/cjs/loader:634:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1061:27)
at Module._load (node:internal/modules/cjs/loader:920:27)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at 552 (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11590)
at __webpack_require__ (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
at 270 (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:400)
at __webpack_require__ (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
at 327 (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:260)
at __webpack_require__ (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
at 845 (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:3733) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
A straightforward option, would be to have two nixpkgs inputs in the flake, the newer one, and the older one to give us Node v14.18.1. However, this is pretty disappointing. I'll look into some other options like upgrading postcss.
I found some discussion of the error at https://github.com/orgs/postcss/discussions/1656 and https://github.com/facebook/create-react-app/issues/11565. Other mentions are for a similar error:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports"
@simeoncarstens it might be helpful to supply the discussion you found via Google if you still have it.
If we override yarn
to use Node v14.21.3, then all is well. See PR #458.
Describe the bug Running the client web app using
yarn dev
from within the Nix shell used to spin up a development server onlocalhost:3000
, which was very handy in conjunction with the Minikube deployment. Now it's broken with the following error:I believe that's due to a too new (:slightly_frowning_face:)
node
version, at least according to Google. Mostly like this was introduced in a recentnixpkgs
bump. Fixing nixpkgs to 21.11 in the flake made it work again, se we might need some kind of override for Node or see whether we can make this work with the current version.To Reproduce
cd app/client && yarn && yarn dev
Expected behavior Dev server should spin up.