Repository navigation
fix(test): resolve aliases in dynamically imported CommonJS on Node 22 - #43943
Conversation
2cfe25e to
57166b3
Compare
Test results for "MCP"Warning The triggering workflow run ended with status 4478 passed, 502 skipped Merge workflow run. |
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"Warning The triggering workflow run ended with status 1 flaky23533 passed, 705 skipped Merge workflow run. |
…ed CommonJS on Node 22
Test results for "tests 2"Warning The triggering workflow run ended with status 12 flaky126999 passed, 4108 skipped Merge workflow run. |
Node 22 resolves
require()inside dynamically imported CommonJS throughModule._resolveFilenamebefore consulting synchronous loader hooks. Retain the existing CommonJS resolver wrapper with both loader modes so nested tsconfig aliases resolve; keep the CommonJS transformation hook limited to the asynchronous loader.Extend the existing dynamic-import test with an aliased dependency and an aliased import call.
Verification
On Linux, Node 22.23.4 and 24.22.2: 93 loader/ESM tests and 34 resolver tests pass on each version. The regression fails on Node 22 with production source restored to main and passes with the fix on both versions. The reported lazy-fixture example also passes with the fix on both versions. Build and
npm run flintpass.Fixes #43939
Triaged on Linux by the Playwright bot - agent run