Closed
Conversation
no ChunkLoadError is possible then.
Contributor
|
Let's upgrade to TS 5.9 (#1780), then look into this |
fc301c0 to
3955fe2
Compare
Effectively synonymous with nodenext.
already implied by tsconfig compilerOptions.module=node20
webmaster128
reviewed
Aug 7, 2025
| target: target, | ||
| entry: globSync("./build/**/*.spec.js", { dotRelative: true }).sort(), | ||
| output: { | ||
| asyncChunks: false, |
Contributor
There was a problem hiding this comment.
Don't we need this for all webpack config files?
| "module": "commonjs", | ||
| "moduleResolution": "node", | ||
| "lib": ["es2022"], | ||
| "target": "es2022", |
Contributor
There was a problem hiding this comment.
This change should go to the CHANGELOG I guess as users will receive more modern JS output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Node 20 is the current minimum supported version, and node 20 is
nodenextas of TypeScript 5.8. (TypeScript 5.9 will add an explicitnode20setting. microsoft/TypeScript#61805)https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping#node-20
https://www.typescriptlang.org/docs/handbook/modules/reference.html#the-module-compiler-option
With this change,
await import()is no longer transpiled into arequire()call, and webpack'sresolve.fallback(which is performed at build time) doesn't seem to work on dynamic imports (maybe it does with some extra configuration...but documentation doesn't say what). Unlike withrequire()webpack trusts that it'll resolve at runtime, so long asasyncChunks: true. So turn async chunks off, unit tests don't need that.(This appears to be an entirely undocumented and convoluted footgun interaction between the configuration options.)
https://webpack.js.org/configuration/output/#outputasyncchunks
https://webpack.js.org/configuration/resolve/
webpack/webpack#18028 (reply in thread)