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

Elusive breakage of Add all missing imports source action. Needs further investigation. #134

Open
ericchase opened this issue Oct 22, 2024 · 10 comments

Comments

@ericchase
Copy link

ericchase commented Oct 22, 2024

The JavaScript and TypeScript Nightly v5.7.20240911 update broke some part of the Add all missing imports source action. Ever since then, some imports would be incorrectly imported with the type only attribute; i.e.

import type {} from "";

instead of

import {} from "";

for situations where type only imports are not correct.

@ericchase
Copy link
Author

ericchase commented Oct 22, 2024

JavaScript and TypeScript Nightly v5.7.20240904 works as expected, as far as I can tell.

@mjbvz
Copy link
Contributor

mjbvz commented Oct 22, 2024

What about the current release, v5.7.20241021?

@ericchase
Copy link
Author

ericchase commented Oct 23, 2024

did someone literally just fix this the same day? that's insane unlikely

@ericchase
Copy link
Author

ericchase commented Oct 23, 2024

hmm, i made the mistake of not cloning the current state of my project in which this issue occurred, and now i can't reproduce it. well, next time i run into the problem again (this is NOT a single instance. it has happened to me in other projects), i will try to remember to freeze it

@ericchase ericchase changed the title JavaScript and TypeScript Nightly v5.7.20240911 Breaks Add all missing imports Source Action Elusive breakage of Add all missing imports source action. Needs further investigation. Oct 23, 2024
@ericchase
Copy link
Author

looking back, i didn't perform as thorough an investigation as i should have. if i run into the same behavior again, i'll try to remember to push a repro and test it on a clean os installation.

i'll close this for now as not reproducible

@ericchase ericchase closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2024
@ericchase
Copy link
Author

yay, the problem is happening again, i'll freeze this project and try to create a minimal reproduction. stay tuned

@ericchase ericchase reopened this Oct 24, 2024
@ericchase
Copy link
Author

A demonstration of how the Add all missing imports source action is broken, but normal Add import from ... works as expected.
Image

2024-10-24_09.42.43.mp4

@ericchase
Copy link
Author

here is the most minimal reproduction i could make with actual code that i use:

for anyone who is familiar with Windows Sandbox, here is my fresh installation demonstrating the bug with completely fresh everything:

as promised, v5.7.20240904 works as expected:
Image

any version after that does not work as expected:
Image

@ericchase
Copy link
Author

just in case:
Image

it's hard to explain to non-windows users what Windows Sandbox is and how it's almost literally a "brand-new installation of Windows"[1], so there are no user settings or configurations whatsoever. this is a brand-new installation of vscode with no settings or configurations whatsoever.

[1] https://learn.microsoft.com/en-us/windows/security/application-security/application-isolation/windows-sandbox/windows-sandbox-overview

@ericchase
Copy link
Author

oh right, i almost forgot the most important part:

tsconfig.json

{
  "compilerOptions": {
    "verbatimModuleSyntax": true
  }
}

this bug only happens when this property is enabled

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

2 participants