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

Creating a new app is broken with node 17 because of postcss version #11733

Open
PawelMorawian opened this issue Dec 10, 2021 · 3 comments
Open

Comments

@PawelMorawian
Copy link

Describe the bug

After creating a new app with create-react-app it won't start:

yarn run v1.22.17
$ react-scripts start
node:internal/modules/cjs/loader:488
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /home/pawel/dev/baz/node_modules/postcss-safe-parser/node_modules/postcss/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:683: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> (/home/pawel/dev/baz/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v17.1.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It seems that the version of postcss-safe-parser used by create-react-app is not working with node 17: postcss/postcss-safe-parser#29

Steps to reproduce

  1. Install node 17
  2. Create a new app with create-react-app foo
  3. cd foo
  4. yarn start or npm start
  5. The app won't start, the error above is the reason
@PawelMorawian PawelMorawian changed the title Creating a new app is broken with node 17 because Creating a new app is broken with node 17 because of postcss version Dec 10, 2021
@scorpion35
Copy link

Not the fix for this bug, but in case anyone needs workaround until this issue is fixed - https://stackoverflow.com/a/69698758/1946418

@leonardopn
Copy link

Same problem

1 similar comment
@fabian4
Copy link

fabian4 commented Dec 15, 2021

Same problem

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

4 participants