There is an issue with types when using create-react-app inside a monorepo.
Here are the steps to reproduce the bug:
pnpm init
# create a pnpm-workspace.yaml file
cat pnpm-workspace.yaml
packages:
- "apps/**"
# create a react app, node_modules will be created on the app folder, not the monorepo root
pnpm create react-app@latest apps/test-app test --template typescript
# at this point, if we run start, everything goes as planned
pnpm --filter test-app start
# we delete the apps/test-app/node_modules folder and mimic a real monorepo install
rm -fr apps/test-app/node_modules
pnpm install
# now node_modules is at the monorepo root, but ...
pnpm --filter test-app start # we'll get error: Property 'toBeInTheDocument' does not exist on type 'JestMatchers<HTMLElement>'.
I found that adding this dependency fixes the issue
There is an issue with types when using create-react-app inside a monorepo.
Here are the steps to reproduce the bug:
I found that adding this dependency fixes the issue
Run install again: