Skip to content

react-scripts depends specifically on [email protected] #8808

Closed
@sjmeverett

Description

@sjmeverett

Describe the bug

If you create a new react-app inside a yarn workspace, using yarn berry and typescript, you'll get an error when you try to run:

Failed to compile.

TypeScript error in undefined(undefined,undefined):
Cannot find type definition file for 'jest'.  TS2688

This is bug #876 on yarnpkg/berry.

@arcanis has provided a fix to ts-pnp but this is version 1.2.0.

All that needs done as far as I can see is to upgrade the dependency on ts-pnp in react-scripts to 1.2.0.

Did you try recovering your dependencies?

Yarn version: 2.0.0-rc.31

Steps to reproduce

  1. create package.json with workspace setup
  2. mkdir packages
  3. cd packages
  4. yarn dlx create-react-app app --template typescript
  5. rm -rf app/.git app/.yarn app/yarn.lock app/.pnp.js
  6. yarn
  7. cd app
  8. yarn start

Expected behavior

I expected that it would run without error.

Actual behavior

I get the following error:

Failed to compile.

TypeScript error in undefined(undefined,undefined):
Cannot find type definition file for 'jest'.  TS2688

Reproducible demo

See https://github.com/sjmeverett/berry-react-app

Note that I can confirm updating the package manually makes it work, as I've put the following in my .yarnrc.yml as a workaround:

packageExtensions:
  react-scripts@*:
    dependencies:
      ts-pnp: "^1.2.0"

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions