Skip to content
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

[Feature] Skip typescript patch on nodeLinker: node-modules #3275

Closed
2 tasks
mizchi opened this issue Aug 12, 2021 · 1 comment · Fixed by #3297
Closed
2 tasks

[Feature] Skip typescript patch on nodeLinker: node-modules #3275

mizchi opened this issue Aug 12, 2021 · 1 comment · Fixed by #3297
Labels
enhancement New feature or request

Comments

@mizchi
Copy link

mizchi commented Aug 12, 2021

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

I use typescript as frontend module on vite compiler.

yarn v3.0.0 patches typescript that can not compile to frontend.

 > node_modules/typescript/lib/typescript.js:115012:37: error: Could not resolve "pnpapi" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)
    115012 │                 var pnpApi = require("pnpapi");
           ╵                                      ~~~~~~~~

20:36:49 [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/typescript/lib/typescript.js:115012:37: error: Could not resolve "pnpapi" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)

I can not avoid this on yarn v3 environment.

Describe the solution you'd like

I'm using yarn v3 with nodeLinker: node-modules. In this case, typescript patch is not required.

I need skip patch option for typescript.

Describe the drawbacks of your solution

Describe alternatives you've considered

@mizchi mizchi added the enhancement New feature or request label Aug 12, 2021
@merceyz
Copy link
Member

merceyz commented Aug 25, 2021

We don't plan on disabling the patch (see https://yarnpkg.com/getting-started/qa/#why-is-typescript-patched-even-if-i-dont-use-plugnplay) but I will remove the direct requires to pnpapi in #3297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants