Skip to content

nodenext allows trailing slash module specifier to match . export #47805

Open
@andrewbranch

Description

@andrewbranch

Bug Report

🔎 Search Terms

nodenext trailing slash

💻 Code

// @Filename: /node_modules/foo/package.json
{
  "name": "foo",
  "exports": {
    ".": "./index.d.ts"
  }
}

// @Filename: /node_modules/foo/index.d.ts
export {};

// @Filename: /index.ts
import {} from "foo/";

🙁 Actual behavior

No error

🙂 Expected behavior

Error on module specifier to match Node behavior: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './' is not defined by "exports"

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: ES ModulesThe issue relates to import/export style module behavior

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions