Open n-riesco opened 3 years ago
I've created the file index.mjs with:
index.mjs
const test = "test"; export default test;
and run the following:
$ node -r esm > import test1 from '.'; > test1 'test' > vm.runInThisContext("import test2 from '.';") Uncaught: Syntax Error: Cannot use import statement inside the Node.js REPL, alternatively use dynamic import >
esm works with the code run by Node.js REPL, but it doesn't with the code run by vm.runInThisContext
esm
vm.runInThisContext
I've searched other issues: #791 maybe related.
The test was run with Node v14.8.0
I've created the file
index.mjs
with:and run the following:
esm
works with the code run by Node.js REPL, but it doesn't with the code run byvm.runInThisContext
I've searched other issues: #791 maybe related.
The test was run with Node v14.8.0