Skip to content

tsserver with "module": "Preserve" and "moduleResolution": "Bundler" adds .js extensions to importsΒ #59200

Open
@segevfiner

Description

πŸ”Ž Search Terms

Preserve, Bundler, .js extension

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about completions

⏯ Playground Link

https://github.com/segevfiner/typescript-js-extension-issue

πŸ’» Code

Completion in the "./foo" in the lines below uncommented results in ./foo.js despite using "moduleResolution": "Bundler".

// import { FOO } from "./foo";
// import { FOO } from "./foo.js";

πŸ™ Actual behavior

It completes to ./foo.js

πŸ™‚ Expected behavior

It should complete to ./foo as we are in "moduleResolution": "Bundler" but "module": "Preserve" causes it to add the js extension.

Additional information about the issue

No response

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions