Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: can the package be used in esm? #41

Open
aladdin-add opened this issue Mar 4, 2022 · 5 comments · May be fixed by #47
Open

question: can the package be used in esm? #41

aladdin-add opened this issue Mar 4, 2022 · 5 comments · May be fixed by #47

Comments

@aladdin-add
Copy link

No description provided.

@aladdin-add aladdin-add changed the title question: should the package be used in esm? question: can the package be used in esm? Apr 25, 2022
@cbratschi
Copy link

Tried it and got: TypeError: Invalid host defined options

@BoyYangzai
Copy link

can it be resolved?

@robhogan
Copy link

robhogan commented Sep 27, 2023

The root of this looks to be the use import() (not necessarily importing ESM) from a VM nodejs/node#35889 - this has been buggy in Node at least until nodejs/node#48510.

At a minimum, it looks like v8-compile-cache needs to implement importModuleDynamically when calling vm.Script but that API looks pretty unstable in recent Node releases, and:

We do not recommend using it in a production environment.

Repro for experimenting with this: https://github.com/robhogan/v8-compile-cache-issue

@JulioC
Copy link

JulioC commented Sep 27, 2023

At a minimum, it looks like v8-compile-cache needs to implement importModuleDynamically when calling vm.Script but that API looks pretty unstable in recent Node releases, and:

There is an open PR with a fix using importModuleDynamically: #47

@mmmmmmmgo
Copy link

If not, can you support ignoring esm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants