ChakraCore
ChakraCore copied to clipboard
ES6 module : unable to find an object from imports
If we have import and export for a module and if that module is exported as namespace object then we unable to find that export from the namespace object. consider this test.js
WScript.LoadScriptFile("test1.js", "module");
test1.js (R)
import * as module1 from "module1.js";
function test() {
return module1.simpleExport();
}
console.log(test());
module1.js (D1)
import * as module2 from "module2.js";
export function simpleExport() { return 'exported'; }
module2.js (D2)
export function simpleExport() { return 'module2.exported'; }
ch -es6module test.js produces TypeError: Object doesn't support property or method 'simpleExport' at test (:4:5) at Anonymous function (:7:1) at module (:1:1)
Fix pushed.