-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
esm: some deep requires don't work #1902
Comments
I've spent some time experimenting with this (based on extending an existing test d0a63b2), and I don't think we can do any better than what's there now unfortunately.
So I think the least worst strategy is:
|
Sounds good to me. I always thought deep requires were a bit of a hack anyway, no? |
@mattwynne agreed - they're always a symptom of something else. |
Closing the loop on this, I went back over this comment from @jan-molak regarding deep import usages in the wild:
So in the next RC we should be all good. |
Thanks @davidjgoss - I'll give that a try soon |
Describe the bug
Not exactly about ESM, but a symptom of the way we've made the package "hybrid".
Some
require
statements that work fine when everything's CommonJS don't work with new ESM-aware Node versions and our module config.To Reproduce
Steps to reproduce the behavior:
@cucumber/[email protected]
and@cucumber/pretty-formatter
--format @cucumber/pretty-formatter
Expected behavior
Normal test run with output from the formatter.
Actual behaviour
Additional context
The stack trace leads to this require statement in the pretty formatter's compiled code:
We have this mapping in our
package.json
:The actual file it should be importing is:
We'll need to either improve this exports mapping or rethink how we're accomodating ESM.
The text was updated successfully, but these errors were encountered: