module: add dynamic file-specific ESM warnings #60035
Annotations
2 errors and 1 notice
Re-run test in a folder whose name contains unusual chars:
test/es-module/test-typescript-commonjs.mjs#L1
--- stdout ---
Test failure: 'expect failure of an .mts file with CommonJS syntax'
Location: test/es-module/test-typescript-commonjs.mjs:61:1
AssertionError [ERR_ASSERTION]: The input did not match the regular expression /Failed to load the ES module: \/Users\/runner\/work\/node\/node\/dir%20with $unusual"chars?'åß∂ƒ©∆¬…`\/test\/fixtures\/typescript\/cts\/test-cts-but-module-syntax.cts. Make sure to set "type": "module" in the nearest package.json file or use the .mjs extension./. Input:
'(node:67004) Warning: Failed to load the ES module: /Users/runner/work/node/node/dir%20with $unusual"chars?\'Ã¥Ã\x9Fâ\x88\x82Æ\x92©â\x88\x86¬â\x80¦`/test/fixtures/typescript/cts/test-cts-but-module-syntax.cts. Make sure to set "type": "module" in the nearest package.json file or use the .mjs extension.\n' +
'(Use `node --trace-warnings ...` to show where the warning was created)\n' +
'/Users/runner/work/node/node/dir%20with $unusual"chars?\'åß∂ƒ©∆¬…`/test/fixtures/typescript/cts/test-cts-but-module-syntax.cts:1\n' +
"import util from 'node:util';\n" +
'^^^^^^\n' +
'\n' +
'SyntaxError: Cannot use import statement outside a module\n' +
' at wrapSafe (node:internal/modules/cjs/loader:1670:18)\n' +
' at Module._compile (node:internal/modules/cjs/loader:1712:20)\n' +
' at Object.loadCTS [as .cts] (node:internal/modules/cjs/loader:1801:10)\n' +
' at Module.load (node:internal/modules/cjs/loader:1473:32)\n' +
' at Function._load (node:internal/modules/cjs/loader:1285:12)\n' +
' at TracingChannel.traceSync (node:diagnostics_channel:322:14)\n' +
' at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)\n' +
' at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:151:5)\n' +
' at node:internal/main/run_main_module:33:47\n' +
'\n' +
'Node.js v24.0.0-pre\n'
at TestContext.<anonymous> (file:///Users/runner/work/node/node/dir%20with%20$unusual%22chars%3F'%C3%A5%C3%9F%E2%88%82%C6%92%C2%A9%E2%88%86%C2%AC%E2%80%A6%60/test/es-module/test-typescript-commonjs.mjs:68:3)
at async Test.run (node:internal/test_runner/test:981:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:678:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: '(node:67004) Warning: Failed to load the ES module: /Users/runner/work/node/node/dir%20with $unusual"chars?\'Ã¥Ã\x9Fâ\x88\x82Æ\x92©â\x88\x86¬â\x80¦`/test/fixtures/typescript/cts/test-cts-but-module-syntax.cts. Make sure to set "type": "module" in the nearest package.json file or use the .mjs extension.\n' +
'(Use `node --trace-warnings ...` to show where the warning was created)\n' +
'/Users/runner/work/node/node/dir%20with $unusual"chars?\'åß∂ƒ©∆¬…`/test/fixtures/typescript/cts/test-cts-but-module-syntax.cts:1\n' +
"import util from 'node:util';\n" +
'^^^^^^\n' +
'\n' +
'SyntaxError: Cannot use import statement outside a module\n' +
' at wrapSafe (node:internal/modules/cjs/loader:1670:18)\n' +
' at Module._compile (node:internal/modules/cjs/loader:1712:20)\n' +
' at Object.loadCTS [as .cts] (node:internal/modules/cjs/loader:1801:10)\n' +
'...',
expected: /Failed to load the ES module: \/Users\/runner\/work\/node\/node\/dir%20with $unusual"chars?'åß∂ƒ©∆¬…`\/test\/fixtures\/typescript\/cts\/test-cts-but-module-syntax.cts. Make sure to set "type": "module" in the nearest package.json file or use the .mjs extension./,
operator: 'match'
}
Command: out/Release/node --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout "/Users/runner/work/node/node/dir%20with $unusual"chars?'åß∂ƒ©∆¬…`/test/es-module/test-typescript-commonjs.mjs"
|
Re-run test in a folder whose name contains unusual chars
Process completed with exit code 1.
|
Post Set up sccache
0% - 0 hits, 0 misses, 0 errors
|
Loading