Bug Report
馃攷 Search Terms
- self-referencing
- self-referencing package
- node12
- module resolution
馃晽 Version & Regression Information
TypeScript 4.5 Beta and TypeScript Nightly
馃檨 Actual behavior
Given the next package.json:
{
"name": "@scope/package",
"type": "module",
"main": "./compiled/src/index.cjs",
"exports": {
"import": "./compiled/src/index.js",
"require": "./compiled/src/index.cjs"
},
...
}
And the following tsconfig.json:
{
"module": "node12",
...
}
The following code does not compile:
import * as src from "@scope/package"
The obtained error is Cannot find module '@scope/package' or its corresponding type declarations.
馃檪 Expected behavior
TSC currently compile self-referencing package that has unscoped names. TSC should also compile self-referencing scoped packages such as @scope/package.
Bug Report
馃攷 Search Terms
馃晽 Version & Regression Information
TypeScript 4.5 Beta and TypeScript Nightly
馃檨 Actual behavior
Given the next package.json:
{ "name": "@scope/package", "type": "module", "main": "./compiled/src/index.cjs", "exports": { "import": "./compiled/src/index.js", "require": "./compiled/src/index.cjs" }, ... }And the following tsconfig.json:
{ "module": "node12", ... }The following code does not compile:
The obtained error is
Cannot find module '@scope/package' or its corresponding type declarations.馃檪 Expected behavior
TSC currently compile self-referencing package that has unscoped names. TSC should also compile self-referencing scoped packages such as
@scope/package.