-
Notifications
You must be signed in to change notification settings - Fork 25.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v13 is not compatible with "moduleResolution": "node12" of Typescript 4.5 #43886
Comments
Or native ESM actually. |
Using TypeScript 4.5 is not yet supported and we haven't verified how it works in any way yet, especially not in combination with its Interestingly, the TypeScript team is considering making |
That's only because the JS bundles in |
Yeah, sorry, I've just realized that. 😅 |
I explored this in #45775 which revealed the following error when bundling:
After talking to @devversion, the problem appears to be that Bazel emits .mjs files while the imports are referring to .js. Getting around this is somewhat tricky with our current build setup. For future reference, I wrote this script that adds the |
Yes, to capture some more details here: Long-term the best solution is to actually use the explicit extension (like @crisbeto built a script for). For now, all of our packages should be compatible with strict ESM at runtime and both with TypeScript's new resolution because runtime code, as well as types are bundled (mitigating the need of an explicit extension). This is now enforced with #45405. Its worth noting that compiler-cli and |
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
No
Description
.js
suffix is required for native ESM on Node 12+ for all relative or absolute import statementshttps://github.com/angular/angular/blob/master/packages/compiler/index.ts#L14
Please provide a link to a minimal reproduction of the bug
microsoft/TypeScript#46408 (comment)
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
Anything else?
No response
The text was updated successfully, but these errors were encountered: