Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /app/workbench-webui/node_modules/postcss-safe-parser/node_modules/postcss/package.json
at new NodeError (node:internal/errors:372:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
at packageExportsResolve (node:internal/modules/esm/resolve:719:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/app/workbench-webui/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Approach
NodeJS 18 is the newest LTS, and we need to support it to stay current with build tools, base images, etc
React 17 and prior versions of webpack (v4?) that are used by react-scripts do not support some of the new features of Node 18, so we'll need to upgrade some other things to get everything back to a state where it builds
This, in tandem with the new build actions for running yarn build should notify us a bit earlier when these things break
How to Test
Prerequisite: using NodeJS 18 (LTS)
Checkout and run this branch locally
yarn install
yarn swagger
yarn build
If all of these complete successfully, then the issue is resolved
Problem
yarn build
fails with an error:Approach
NodeJS 18 is the newest LTS, and we need to support it to stay current with build tools, base images, etc
React 17 and prior versions of webpack (v4?) that are used by
react-scripts
do not support some of the new features of Node 18, so we'll need to upgrade some other things to get everything back to a state where it buildsThis, in tandem with the new build actions for running
yarn build
should notify us a bit earlier when these things breakHow to Test
Prerequisite: using NodeJS 18 (LTS)
yarn install
yarn swagger
yarn build
If all of these complete successfully, then the issue is resolved