Closed frank-dspeed closed 4 years ago
a little extra info maybe related if we would add into module.js
console.log('ctx',module) // befor the console.log('sideEffect')
it will silent fail all other instructions that come after that and so will not execute the secund console call any access to module when loaded via dynamic import makes graal simply fail silent while it would all work with require from cjs
Thanks @frank-dspeed, we'll have a look
Solved sorry for creating that issue it is related to a other project
graaljs inside JVM dynamic import broken interop
ESM & CJS can not dynamic import additional CJS modules inside it also accessing module object inside cjs breaks graalvm silent when loaded via dynamic import inside ESM
JS can also not dynamic import CJS same behavior!
Reproduce able example
module.js
index.mjs
index.js
Conclusion
dynamicImport import() at present only supports ESM no matter if used in ESM context or CJS i think also that the current dynamic import implementation does not hornor .mjs === ESM and .cjs === commonjs(require,module)