-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
TypeScript incorrectly auto-importing string from fp-ts. #48075
Comments
Bug reports should follow the issue template for bug reports to help the TypeScript team triage and address the issue. |
Just to note, not only does this happen with |
I 👍 this earlier so I assume I could repro it at the time, or maybe I just repro’d it in the Code Sanbdbox which is using TypeScript 4.5, but I can’t repro on nightly:
@kkirby or @willmanduffy, can you confirm that this is fixed when you use typescript@next as your VS Code TS version? |
@andrewbranch Still broken for me when using typescript@next: From the ts server log file:
|
What the heck. @kkirby would you mind throwing that test project in a gist/repo/zip and sending it to me? |
@andrewbranch Sure, here: https://github.com/kkirby/typescript-issue-48075 I will point out that upon opening the project, I didn't initially get the issue to occur. I had to give it awhile. Maybe the TypeScript server was still caching stuff or whatever. Let me know how it goes. There's a file in the repo called "repo_steps.mp4" that shows the problem occurring in that project. |
Ah, ok—the thing I was doing to make it more likely to happen—importing from |
Bug Report
I originally commented on this issue: #35395 but was directed to make a new issue.
If I have fp-ts installed to my project, and then type something like:
The TypeScript language server auto-imports
string
fromfp-ts
.A minimum reproduction can be done on CodeSandbox. Simply create an empty TypeScript project. Add fp-ts to the dependencies. Then type the code above in the editor and you'll see that it wants to auto-import string from fp-ts:
If it doesn't pop up right away you might need to trigger the auto-complete by hitting ctrl-space on your keyboard.
Here's a pre-created CodeSandbox to test with: https://codesandbox.io/s/bitter-shape-3rnzh9?file=/src/index.ts
🔎 Search Terms
N/A
🕗 Version & Regression Information
Tested 4.4.5, 4.6.2
🙁 Actual behavior
TypeScript auto-imports
string
fromfp-ts
.🙂 Expected behavior
TypeScript does not auto-imports
string
fromfp-ts
.The text was updated successfully, but these errors were encountered: