Closed nielk closed 1 month ago
Thanks for the report, I confirm the bug. On the user-land there are 2 options:
module
field to node16
or nodenext
in tsconfig.json
(recommended). Then TypeScript will resolve #
imports. But I believe there always be projects sticked to commonjs, so I will investigate and maybe revert subpath imports for now or clarify that in docs"skipLibCheck": true
@nielk could you check, does it work for you?
2. "skipLibCheck": true
It does the job, thank you!
By the way, if you set module
to node16
- does it break something in you project?
Per TS docs - there should not be any strong reasons to stick with commonjs
. But I'm curious, how it goes in real projects.
Subpath imports were reverted.
By the way, if you set
module
tonode16
- does it break something in you project? Per TS docs - there should not be any strong reasons to stick withcommonjs
. But I'm curious, how it goes in real projects.
Sorry for the late response, on my project every time we struggled with esm stuff it was because we use npm package that did not migrated to esm yet.
Given
When
When I run
npx tsc --noEmit
Then
I get this error:
But I expect
I expect that
d.ts
files do not include path alias#
but../../
instead. Because external project have no clue about the path alias used in playwright-bdd package ?Isolated demo
https://github.com/nielk/playwright-bdd-example/pull/1
Occurs after running
npm run build
Environment