Steps to Reproduce:
.js to the end of files when importing a javascript module. This is using the new ESM features added to node on 13.2.js is required when importing javascript modules with the new ESM syntax
Does this issue occur when all extensions are disabled?: Yes
More information here: https://nodejs.org/api/esm.html#esm_package_scope_and_file_extensions
Duplicate of https://github.com/microsoft/TypeScript/issues/16577 I believe
@mjbvz : Why close this issue? It's in the Visual Studio Code IDE: its "Auto Import from..." feature in JavaScript files is currently generating code that can't run without transpilation in Node and web browsers.
There's a Settings option today to use relative paths for import statments it generates. It should add a second to use full paths (with file name extensions).
Because the auto import suggestions are powered by the TypeScript project...
Will a new option in TypeScript to enable browser- and node-style ESM imports automatically propagate to a new Settings option in VS Code? Otherwise shouldn't this be left open, tracking that one as a dependency?
@mjbvz What component of TypeScript do the auto-import suggestions come from? Maybe from the Language Server?
If so, we should file a request specifically with the Language Server. I'm happy to file it, but I first want to make sure that's where the suggestions come from.
(The bug referenced earlier is about the Transpiler itself, not the Language Server ... or at least that's where the discussion on that bug has ended up.)
Better upstream issue: https://github.com/microsoft/TypeScript/issues/24779. It specifically tracks adding file extensions during auto import
Most helpful comment
Better upstream issue: https://github.com/microsoft/TypeScript/issues/24779. It specifically tracks adding file extensions during auto import