Closed
Description
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
- create
package.json
with workspace setup mkdir packages
cd packages
yarn dlx create-react-app app --template typescript
rm -rf app/.git app/.yarn app/yarn.lock app/.pnp.js
yarn
cd app
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!