Open
Description
Minimal example:
test.js
import path from 'path';
test.py
from pathlib import Path
runs fine in Python, but throws the following error in Javascript:
<anonymous_script>:1
import path from 'path';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at file:///[...]/test.py.js:2:9
at ModuleJob.run (node:internal/modules/esm/module_job:274:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
Node.js v23.10.0
Metadata
Metadata
Assignees
Labels
No labels