-
-
Notifications
You must be signed in to change notification settings - Fork 27k
yarn pnp doesn't work with typescript #5647
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
The problem is that even if we get around the |
No it's actually a bit easier in this case. TypeScript support for So having pnp support inside the TS compilers is doable. It's already in |
Any updates? |
I haven't had the time yet to work on TypeStrong/fork-ts-checker-webpack-plugin#181 - it would be awesome if someone could help on this (I've already made a similar PR on ts-loader that can be used as inspiration: TypeStrong/ts-loader#862). |
Any chance of seeing this land on 3.0 ? This would be really helpful, my team is getting depressed because of the long install times on our monorepo... |
I'm a bit short on time with the work on Yarn v2 and personal stuff, but I can offer advices and review time if you want to implement the |
I found the time and pushed a PR: TypeStrong/fork-ts-checker-webpack-plugin#250 Once merged I'll make another one to create-react-app to upgrade fork-ts-checker-webpack-plugin and add support for the resolvers 🙂 |
PR up at #6856 |
The solution for this shouldn't be in webpack, but in tsc and typescript-language-server. :-\ |
@NullVoxPopuli Yes but as you just saw in microsoft/TypeScript#28289 this does not seem like it is going to happen anytime soon, so I guess moving on with the proposed fix is the way to go. |
Is this in 3.0.1? It says it is in the release notes but the error is still there.
|
@alaatm I've got similar error when I run TL;DR; Run |
@damianfijorek That's weird, but the workaround did not work for me -.- |
yarn@1.12.3 with create-react-app@3.0.1 in node 10 on win 10 fails for me:
and the same on node 12.7 fails differently:
|
This works but is needlessly complicated:
yarn set version berry
yarn dlx create-react-app --template typescript my-app
cd my-app
yarn add @yarnpkg/pnpify -D
yarn pnpify --sdk
// Open with vscode
// Go to currently broken tsx file
// Hit Ctrl+Shift+P, choose select Typescript version -> Use Workspace Version Pnipify
// Reload Vscode window
// Finally you might want to remove extra files from the root
// Then run `yarn set version berry` in my-app too |
Updating workaround from @Ciantic ....
VSCode seems to use the workspace sdk when "typescript.tsdk" is set appropriately
|
Set up a pnp typescript project
npx create-react-app pnp --use-pnp --typescript
ornpx create-react-app pnp --typescript --use-pnp
order doesn't matterYou then get
Environment
The text was updated successfully, but these errors were encountered: