Skip to content

Provide better errors on module: node12 and extensionless imports #46152

Closed

Description

When an extensionless import fails from an ES module when moduleResolution is effectively node12/nodenext, we currently issue a useless error message.

// @filename: ./foo.mts
export function foo() {
}

// @filename: ./bar.mts
import foo from "./foo";
// error: Cannot find module './foo' or its corresponding type declarations.

Instead, we should see if we managed to find any files with an extension, or at least mention that an extensionless import is likely to fail.

Activity

  1. added
    Domain: Error Messages
    Suggestion
    Effort: Casual
    Effort: Moderate
    and removed
    Effort: Casual
    on Oct 11, 2021
  2. added
    Fix Available
    on Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Domain: Error MessagesEffort: ModerateFix AvailableSuggestion

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions