Skip to content

fix: improve ERR_AMBIGUOUS_MODULE_SYNTAX error message #1421

fix: improve ERR_AMBIGUOUS_MODULE_SYNTAX error message

fix: improve ERR_AMBIGUOUS_MODULE_SYNTAX error message #1421

Re-run triggered December 10, 2025 18:48
Status Failure
Total duration 4h 27m 52s
Artifacts 1

test-shared.yml

on: pull_request
Build slim tarball
1m 32s
Build slim tarball
Matrix: build
Fit to window
Zoom out
Zoom in

Annotations

8 errors
aarch64-linux: with shared libraries
Process completed with exit code 2.
aarch64-linux: with shared libraries: test/es-module/test-esm-detect-ambiguous.mjs#L460
--- stdout --- Test failure: 'should throw an ambiguous syntax error when using top-level await with module' Location: test/es-module/test-esm-detect-ambiguous.mjs:450:3 AssertionError [ERR_ASSERTION]: The input did not match the regular expression /ReferenceError: Cannot determine intended module format because both module and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, replace module with import\./. Input: '' at TestContext.<anonymous> (file:///home/runner/work/_temp/node-v26.0.0-nightly2025-12-1013cbc58974-slim/test/es-module/test-esm-detect-ambiguous.mjs:460:12) at process.processTicksAndRejections (node:internal/process/task_queues:103:5) at async Test.run (node:internal/test_runner/test:1102:7) at async Suite.processPendingSubtests (node:internal/test_runner/test:777:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: '', expected: /ReferenceError: Cannot determine intended module format because both module and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, replace module with import\./, operator: 'match', diff: 'simple' } Command: out/Release/node --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout /home/runner/work/_temp/node-v26.0.0-nightly2025-12-1013cbc58974-slim/test/es-module/test-esm-detect-ambiguous.mjs
x86_64-linux: with shared libraries
Process completed with exit code 2.
x86_64-linux: with shared libraries: test/es-module/test-esm-detect-ambiguous.mjs#L460
--- stdout --- Test failure: 'should throw an ambiguous syntax error when using top-level await with module' Location: test/es-module/test-esm-detect-ambiguous.mjs:450:3 AssertionError [ERR_ASSERTION]: The input did not match the regular expression /ReferenceError: Cannot determine intended module format because both module and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, replace module with import\./. Input: '' at TestContext.<anonymous> (file:///home/runner/work/_temp/node-v26.0.0-nightly2025-12-1013cbc58974-slim/test/es-module/test-esm-detect-ambiguous.mjs:460:12) at process.processTicksAndRejections (node:internal/process/task_queues:103:5) at async Test.run (node:internal/test_runner/test:1102:7) at async Suite.processPendingSubtests (node:internal/test_runner/test:777:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: '', expected: /ReferenceError: Cannot determine intended module format because both module and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, replace module with import\./, operator: 'match', diff: 'simple' } Command: out/Release/node --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout /home/runner/work/_temp/node-v26.0.0-nightly2025-12-1013cbc58974-slim/test/es-module/test-esm-detect-ambiguous.mjs
aarch64-darwin: with shared libraries
Process completed with exit code 2.
aarch64-darwin: with shared libraries: test/es-module/test-esm-detect-ambiguous.mjs#L460
--- stdout --- Test failure: 'should throw an ambiguous syntax error when using top-level await with module' Location: test/es-module/test-esm-detect-ambiguous.mjs:450:3 AssertionError [ERR_ASSERTION]: The input did not match the regular expression /ReferenceError: Cannot determine intended module format because both module and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, replace module with import\./. Input: '' at TestContext.<anonymous> (file:///Users/runner/work/_temp/node-v26.0.0-nightly2025-12-1013cbc58974-slim/test/es-module/test-esm-detect-ambiguous.mjs:460:12) at process.processTicksAndRejections (node:internal/process/task_queues:103:5) at async Test.run (node:internal/test_runner/test:1102:7) at async Suite.processPendingSubtests (node:internal/test_runner/test:777:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: '', expected: /ReferenceError: Cannot determine intended module format because both module and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, replace module with import\./, operator: 'match', diff: 'simple' } Command: out/Release/node --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout /Users/runner/work/_temp/node-v26.0.0-nightly2025-12-1013cbc58974-slim/test/es-module/test-esm-detect-ambiguous.mjs
x86_64-darwin: with shared libraries
Process completed with exit code 2.
x86_64-darwin: with shared libraries: test/es-module/test-esm-detect-ambiguous.mjs#L460
--- stdout --- Test failure: 'should throw an ambiguous syntax error when using top-level await with module' Location: test/es-module/test-esm-detect-ambiguous.mjs:450:3 AssertionError [ERR_ASSERTION]: The input did not match the regular expression /ReferenceError: Cannot determine intended module format because both module and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, replace module with import\./. Input: '' at TestContext.<anonymous> (file:///Users/runner/work/_temp/node-v26.0.0-nightly2025-12-1013cbc58974-slim/test/es-module/test-esm-detect-ambiguous.mjs:460:12) at async Test.run (node:internal/test_runner/test:1102:7) at async Suite.processPendingSubtests (node:internal/test_runner/test:777:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: '', expected: /ReferenceError: Cannot determine intended module format because both module and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, replace module with import\./, operator: 'match', diff: 'simple' } Command: out/Release/node --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout /Users/runner/work/_temp/node-v26.0.0-nightly2025-12-1013cbc58974-slim/test/es-module/test-esm-detect-ambiguous.mjs

Artifacts

Produced during runtime
Name Size Digest
tarballs
47.7 MB
sha256:ecb837af0be7afddd72f4dcec0cc4bf8f8b057de49097196e25d9009c47f2195