fix: improve ERR_AMBIGUOUS_MODULE_SYNTAX error message #1421
Annotations
2 errors
|
Build Node.js and run tests
Process completed with exit code 2.
|
|
Build Node.js and run tests:
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
|
Loading