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
If I want to use moduleResolution as node16, currently tsdx ignores what is specified in tsconfig and uses legacy module resolution. This causes typescript errors.
The particular feature that I want to use is package.json exports. For this to work, the moduleResolution should be set to node16. By setting this, typescript errors in vscode disappear, however tsdx build does not succeed (and the error that it gives is similar to what vscode gives without node16 moduleResolution).
Example error:
(typescript) Error: /my/project/src/file/path.ts(5,34): semantic error TS2307: Cannot
find module 'ethers/address' or its corresponding type declarations.
Here, ethers is a package, and address is defined as an export in it's package.json.
It seems this issue is caused in rollup-plugin-typescript2. The user's tsconfig is overridden and moduleResolution is set to legacy node resolution (relevant code).
I've locally tried to patch this. However, the build gets stuck forever. There may be a reason why this is overridden.
Current Behavior
If I want to use
moduleResolution
as node16, currently tsdx ignores what is specified in tsconfig and uses legacy module resolution. This causes typescript errors.The particular feature that I want to use is package.json exports. For this to work, the
moduleResolution
should be set tonode16
. By setting this, typescript errors in vscode disappear, howevertsdx build
does not succeed (and the error that it gives is similar to what vscode gives without node16 moduleResolution).Example error:
Here, ethers is a package, and address is defined as an export in it's package.json.
Expected behavior
It should build.
Suggested solution(s)
Additional context
Your environment
The text was updated successfully, but these errors were encountered: