I'm facing an import issue with the @labrynx/error-enhanced package in a TypeScript project. Specifically, the following import statement does not work:
import { ... } from "@labrynx/error-enhanced";
However, using the relative path does work:
import { ... } from "../node_modules/@labrynx/error-enhanced/dist";
Steps to Reproduce:
- Install the
@labrynx/error-enhanced package.
- Try to import it using
import { ... } from "@labrynx/error-enhanced";
- Observe that the import fails.
Expected Behavior:
The package should be imported successfully using the package alias.
Actual Behavior:
The import fails unless a relative path is used.
Environment:
- Node.js version: >=16.0.0
- npm version: >=8.0.0
- TypeScript version: 5.2.2
Additional Information:
Here is the package.json configuration related to error-enhanced:
{
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": [
"./dist/index.js"
]
}
And here is the tsconfig.json:
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"rootDir": "src",
"outDir": "dist/",
...
}
}
Any help on this would be greatly appreciated.
I'm facing an import issue with the
@labrynx/error-enhancedpackage in a TypeScript project. Specifically, the following import statement does not work:However, using the relative path does work:
Steps to Reproduce:
@labrynx/error-enhancedpackage.import { ... } from "@labrynx/error-enhanced";Expected Behavior:
The package should be imported successfully using the package alias.
Actual Behavior:
The import fails unless a relative path is used.
Environment:
Additional Information:
Here is the
package.jsonconfiguration related toerror-enhanced:{ "main": "./dist/index.js", "types": "./dist/index.d.ts", "exports": [ "./dist/index.js" ] }And here is the
tsconfig.json:{ "compilerOptions": { "target": "es2015", "module": "commonjs", "rootDir": "src", "outDir": "dist/", ... } }Any help on this would be greatly appreciated.