Description
Bug Report
π Search Terms
module resolution bundler synthesized default
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
Playground link with relevant code
π» Code
// @moduleResolution: bundler
// @module: esnext
// @target: esnext
import mdast, { toString } from "mdast-util-to-string"; // types: 3.2.0
mdast.toString
toString
const mdast2 = await import("mdast-util-to-string"); // types: 3.2.0
mdast2.default
mdast2.default.toString
mdast2.toString
export {}
π Actual behavior
default
export is available here and points to the whole module. I don't think this is right, even with moduleResolution: bundler
but I can be wrong about this since it's really hard to know what kind of assumptions and goals this mode has when it comes to subtle details
π Expected behavior
I don't expect default
to be available here since this ESM-only package doesn't have a default export.
Note that even if this isn't a bug, .default
available on that dynamically imported binding should behave in the same way in the IDE as the specifier coming from the import statement. Right now the hover info isn't available on it and go to (type?) definition doesn't work on it with cmd+click.