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

Plugin treats class method as function call and try import not required deps #499

Open
5 tasks done
KawaiiZapic opened this issue May 19, 2024 · 1 comment
Open
5 tasks done

Comments

@KawaiiZapic
Copy link

KawaiiZapic commented May 19, 2024

Describe the bug

if a class include a method that has same name in a present, this plugin will try to inject import statement into this file.
This is ok in common because we only want to import it when we installed it as project deps, but plugin will inject import statement into other repo in monorepo without the dep, and will cause error "dep not found".

In the reproduction, run npm run build, vite will exit with error. If rename inject to inject2, build can be done.

Reproduction

https://stackblitz.com/edit/vitejs-vite-tdqwze?file=src%2Fmain.ts&view=editor

System Info

Not provided

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Copy link

stackblitz bot commented May 19, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

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

No branches or pull requests

1 participant