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

nodejs v18.3.0 Error: Rewiremock: there is no "parent module". Is there two HotModuleReplacementPlugins? #137

Open
Kreijstal opened this issue Jul 28, 2022 · 3 comments

Comments

@Kreijstal
Copy link

can I use rewiremock in native node?
await import("rewiremock"); in the repl throws the error in the title. I am not using any transpiler, simply using native node repl

@theKashey
Copy link
Owner

Probably this is due ESM becoming the "native" mode.
I need to check if rewiremock can exists in the new world (it is not native ESM compatible)

@KristjanTammekivi
Copy link

Have you had an opportunity to check this out yet?

@theKashey
Copy link
Owner

Well, yes. It's not native module compatible as it missing a part("loader") required to modify ESM behaviour and make them mockable. Basically, the requirement is to implement an old module system inside new module system.
Not something I can afford doing 😢

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

No branches or pull requests

3 participants