Skip to content

fix(test): resolve aliases in dynamically imported CommonJS on Node 22 - #43943

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
mainfrom
triage/43939/42116594086-1
Nov 5, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
mainfrom
triage/43939/42116594086-1

Conversation

@microsoft-playwright-automation

Copy link
Copy Markdown
Contributor

Node 22 resolves require() inside dynamically imported CommonJS through Module._resolveFilename before 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 flint pass.

Fixes #43939

Triaged on Linux by the Playwright bot - agent run

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

Warning

The triggering workflow run ended with status cancelled. Results below may be incomplete — blob reports from cancelled or timed-out shards are missing, so passing/failing counts do not reflect the full test suite.

4478 passed, 502 skipped


Merge workflow run.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

Warning

The triggering workflow run ended with status cancelled. Results below may be incomplete — blob reports from cancelled or timed-out shards are missing, so passing/failing counts do not reflect the full test suite.

1 flaky ⚠️ [webkit-page] › page/page-screenshot.spec.ts:990 › page screenshot animations › SS-064 should wait for fonts to load `@webkit-playwright-x64-ubuntu24-64-core-node22`

23533 passed, 705 skipped


Merge workflow run.

@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 3db8701 into main Nov 5, 2026
62 of 64 checks passed
@pavelfeldman
Pavel Feldman (pavelfeldman) deleted the triage/43939/42116594086-1 branch November 5, 2026 23:34
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 2"

Warning

The triggering workflow run ended with status cancelled. Results below may be incomplete — blob reports from cancelled or timed-out shards are missing, so passing/failing counts do not reflect the full test suite.

12 flaky ⚠️ [chromium-page] › page/page-screenshot.spec.ts:534 › page screenshot › SS-039 should take fullPage screenshots during navigation `@tracing-chromium`
⚠️ [chromium-library] › library/chromium/connect-over-cdp.spec.ts:146 › CD-004 should connect when an existing page has been discarded `@chromium-macos-15-large`
⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › VI-030 should work with video+trace `@realtime-time-library-chromium-linux`
⚠️ [firefox-page] › page/page-filechooser.spec.ts:293 › FC-020 should be able to reset selected files with empty file list `@tracing-firefox`
⚠️ [firefox-library] › library/debug-controller.spec.ts:350 › DB-020 should highlight inside iframe `@firefox-macos-15-large`
⚠️ [firefox-library] › library/inspector/cli-codegen-csharp.spec.ts:202 › CG-157 should not print context options method override in mstest if no options were passed `@firefox-macos-15-large`
⚠️ [firefox-library] › library/inspector/cli-codegen-csharp.spec.ts:202 › CG-157 should not print context options method override in xunit if no options were passed `@firefox-macos-15-large`
⚠️ [firefox-library] › library/inspector/cli-codegen-javascript.spec.ts:51 › CG-107 should work with --http-credentials `@firefox-macos-15-large`
⚠️ [firefox-page] › page/page-filechooser.spec.ts:293 › FC-020 should be able to reset selected files with empty file list `@firefox-macos-15-large`
⚠️ [webkit-library] › library/heap.spec.ts:304 › LE-014 cycle handles `@webkit-playwright-x64-server2025-64-core`
⚠️ [webkit-page] › page/page-leaks.spec.ts:164 › LE-004 waitFor should not leak `@webkit-playwright-x64-server2025-64-core`
⚠️ [webkit-library] › library/tracing.spec.ts:565 › TR-023 should produce screencast frames fit `@webkit-macos-15-xlarge`

126999 passed, 4108 skipped


Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Dynamic import() of a TS module loses tsconfig paths resolution on Node 22 (works on Node 24) since 1.64

1 participant