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

import(CJS_USE_DEASYNC) or createRequire(import.meta.url)(CJS_USE_DEASYNC) may leads to endless loop #178

Open
loynoir opened this issue May 12, 2023 · 0 comments

Comments

@loynoir
Copy link

loynoir commented May 12, 2023

Reproduce

https://github.com/loynoir/reproduce-node-47971

Expected

$ node ./test/test-require.cjs
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
{ plugin: [Module: null prototype] { foo: [Function: foo] } }

Actual

$ node ./test/test-import.mjs
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
...
# endless loop
...
$ node ./test/test-createRequire.mjs
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
waiting import('./plugin.mjs')
...
# endless loop
...

Related

nodejs/node#47971

@loynoir loynoir changed the title import(CJS_USE_DEASYNC) may leads to endless loop import(CJS_USE_DEASYNC) or createRequire(import.meta.url)(CJS_USE_DEASYNC) may leads to endless loop May 12, 2023
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

1 participant