Replies: 3 comments 15 replies
-
I've noticed this happening recently as well. It's annoying though it doesn't actually negatively impact the functionality. I would love a fix for this. I like keeping the extensions because I think it mimics native ESM better (which requires file extensions when referencing a file directly), but I could be convinced to just not bother I think. I welcome anyone to dive in and see what can be done about this. I would definitely prefer to have the actual file extension be the one used in the code if possible. |
Beta Was this translation helpful? Give feedback.
-
For me I have a similar strange behavior. all imports work as expected in Remix. however when I run Playwright, it wants all js imports in my app thats shared with it, to all the sudden to have a .js extension
|
Beta Was this translation helpful? Give feedback.
-
VS Code's import resolution behavior seems inconsistent. When resolving relative path imports, it omits the .js extension. However, for imports using aliases (e.g., #app), it includes the .js extension. I've tried adjusting the "typescript.preferences.importModuleSpecifierEnding" setting, but none of the options achieve consistent behavior across both import types. I am not sure if this behavior was caused by some update or just did not notice before. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I was wondering if this behavior is normal. Since Typescript v5.2 (definitely on current v5.4) VS Code automatically add
.js
extension to all auto imports. I cannot change this through any VS Code or Typescript config. I would expect imports with no extension or with.ts
extension. The main problem with.js
extension is that it can sometimes break the build which is definitely not ideal.Do you have any idea what can be causing this or how can I resolve it?
Beta Was this translation helpful? Give feedback.
All reactions