You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And when I call yarn tsc, nodejs trying to run node_modules/typescript/bin/tsc. This file hasn't extension and nodejs throws an error.
Why it works in Jest?
Because it use another bin declaration like this:
{
"jest": "./bin/jest.js"
}
For package manager, this script has link with name jest, but nodejs run jest.js, file with extension.
So, solving my problem is adding .js in bin files and in paths in package.json bin. It won't change behavior for exists project by help projects with configurations like mine.
As you can see, another experimental flags for native modules aren't change behavior (Now I run tsc without --experimental-specifier-resolution, but with all another flags in scripts and it works)
I created pull request with resolution. Can somebody approve it?
DanielRosenwasser
changed the title
Support node es modules resolution
Use explicit extensions in TypeScript's package.json for Node ES resolution compatibility
Jun 1, 2021
Bug Report
π Version & Regression Information
Versions:
β― Playground Link
Minimal repoducible example
π» Code
Run tsc (yarn tsc, yarn exec tsc, npx tsc, ./node_modules/.bin/tsc) with nodejs flag --experimental-specifier-resolution=node (NODE_OPTIONS="--experimental-specifier-resolution=node" tsc)
π Actual behavior
π Expected behavior
Build without errors
The text was updated successfully, but these errors were encountered: