-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Bug] TypeScript Create React App projects do not work within workspaces. #876
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
Comments
I'd just like to add that a similar thing happens for me not in a workspace project, so it might be a red herring that it has anything to do with workspaces. i.e. I run this:
And I get this:
Versions:
|
It also happens in next.js using typescript. root package.json {
...
"workspaces": [
"packages/*"
],
"scripts": {
"build": "yarn workspace dev-test-next-app build",
}
} packages/app/package.json {
...
"name": "dev-test-next-app",
"scripts": {
"build": "next build"
}
} result:
versions:
|
Same issue here. Yarn 2 monorepo with PnP, trying to $ yarn workspace foo start
Failed to compile.
undefined
TypeScript error in undefined(undefined,undefined):
Cannot find type definition file for 'flat'. TS2688 Versions:
|
CRA version 3.4.0 with typescript in yarn 2 workspaces when execute
|
At least in my case removing I believe the YYMV, played around it and removing the roots solved the issue for me with |
I didn't manage to reproduce your issues (even following your repros :(), but @ucarion provided one lately which had the same error: https://github.com/ucarion/berry-next-typescript-repro Thanks to this, I've just released a fix in ts-pnp which I think should also fix any similar problem. If that's not the case, please reopen an issue and 🙏🙏🙏 make sure the repro is as simple as possible so that we can get straight to the fix 🙂 (Note: to use the ts-pnp fix: open your lockfile, remove the ts-pnp entries, then run |
Hi @arcanis, thanks for your work on this. Unfortunately I've still got a problem, please see https://github.com/sjmeverett/berry-react-app for a repro. I can confirm it works for a simple project now though 👍 it's just workspaces that cause a problem. |
Actually I've found the problem. This will get it to work for now (in packageExtensions:
react-scripts@*:
dependencies:
ts-pnp: "^1.2.0" And you may also need to delete the |
I was able to reproduce this when the repo was in |
Uh oh!
There was an error while loading. Please reload this page.
More of a maybe on that. I have no idea why this bug occurs. If I get some hint I could possibly help with implementing a fix. The types for jest are installed, so I'm not sure why they cannot be found.
Describe the bug
To Reproduce
packages
. e.g.create-react-app app --template typescript --pnp
--pnp
flag does anything.yarn.lock
within app, as well as the pnp file.yarn workspace app start
Here's a repo: https://github.com/DylanVann/yarn-berry-create-react-app-bug
Environment if relevant (please complete the following information):
10.15.2
v13.7.0
v2.0.0-rc.28
The text was updated successfully, but these errors were encountered: