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

assertScriptCanLoadAsCJS() can trigger self when loading assertScriptCanLoadAsCJSImpl #1235

Closed
cspotcode opened this issue Feb 22, 2021 · 0 comments · Fixed by #1232
Closed
Milestone

Comments

@cspotcode
Copy link
Collaborator

assertScriptCanLoadAsCJS() loads assertScriptCanLoadAsCJSImpl() on-demand.

It seems that with allowJs / checkJs enabled, our own loader hook is called during the loading process. This causes an error where assertScriptCanLoadAsCJSImpl is invoked before it's loaded.

Also, I need to be sure I understand why our tests weren't catching this before. Is it possible that the "ignore" rules have broken? Or is it that the test cases which uncovered this bug are explicitly disabling "ignore" patterns?

cspotcode added a commit that referenced this issue Feb 22, 2021
cspotcode added a commit that referenced this issue Feb 22, 2021
…empting to execute ESM as CJS, even when ESM loader is not loaded (#1232)

* always throw ERR_REQUIRE_ESM when attempting to execute ESM as CJS, even when ESM loader is not loaded

* cleanup

* Fix #1235

* fix bug
@cspotcode cspotcode added this to the 10.0.0 milestone May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant