ChakraCore
ChakraCore copied to clipboard
How can I import and use a module from file
Hello, how can I import and use a module from file ????
Memo1.Lines.Text:=Engine.ConvertToString(Engine.RunScript('import * as customName from ("./myjs/MyNode.js");'));
Error $30002: JavaScript failed to compile.
Name: SyntaxError
Message: 'import' or 'export' can only be used in module code.
Source: import * as customName from ("./myjs/MyNode.js");
Line: 0
Column: 0
I'm not sure how Chakracore is being invoked in this example, I assume this is via some kind of wrapper tool?
I would need more information about the intermediate layer you're using in order to help.