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

Module commonjs "require.main" is undefined since v4 #2930

Closed
zckrs opened this issue Jan 4, 2022 · 3 comments
Closed

Module commonjs "require.main" is undefined since v4 #2930

zckrs opened this issue Jan 4, 2022 · 3 comments

Comments

@zckrs
Copy link

zckrs commented Jan 4, 2022

Hi,

I try to migrate to v4 from v3.15.
I have a strange bug with project who contains some require.main

main should be a object but we got undefined.

Everything work with alpha 1 & 2 but since rc1 no success on our tests :/

I suspect usage of worker thread but I cant confirm (with option --no-worker-threads we always have bug)

@sindresorhus
Copy link
Member

nodejs/node#41384

@novemberborn
Copy link
Member

This is because AVA's internals are now ESM so there is no require.main available. This is not something that can be resolved by AVA.

@zckrs
Copy link
Author

zckrs commented Jan 5, 2022

Oki legit.
Thanks 👍

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

No branches or pull requests

3 participants