caoccao/Javet

Asynchronous dynamic import

Opened this issue · 6 comments

I'm getting an error when I'm using an asynchronous dynamic import

import('fs').then(obj => { console.log(obj) })

Error
[ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING]: A dynamic import callback was not specified. at importModuleDynamicallyCallback (node:internal/modules/esm/utils:231:9) at c.js:13:1 { code: 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING' }

Please review this doc.

Please review this doc.

I understand this workaround, but your interface start engine doesn't seem to have this setting to solve it

You may pass the args via options. I haven't tried your case, but you could take a try.

You may pass the args via options. I haven't tried your case, but you could take a try.

I'm sorry, I still can't do it, can you update it or help me implement it

You might review this doc for detail.

public NodeRuntimeOptions setConsoleArguments(java.lang.String[] consoleArguments)

您可以查看此文档以了解详细信息。

public NodeRuntimeOptions setConsoleArguments(java.lang.String[] consoleArguments)

There is no Api in NodeRuntime to get NodeRuntimeOptions