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

chore(exports): improve nested conditions #411

Closed
wants to merge 1 commit into from

Conversation

balzdur
Copy link

@balzdur balzdur commented Jun 7, 2022

This proposal follow this issue.

After digging a little bit in the linked issues, I found this issue where this particular comment give an hint on how to solve this module resolution issue.

If I well understood reading the Jest 28 doc we need to provide both require and import exports for browser too.

Further reading on the "exports" spec

NB: This change in local raise the issue in this issue.

close #396

@balzdur balzdur force-pushed the fix/jest-28-esm branch from 1137efc to f61f226 Compare June 7, 2022 10:45
@bluebill1049 bluebill1049 requested a review from jorisre June 7, 2022 11:27
@bluebill1049
Copy link
Member

Thank very much for looking into this ❤️

@balzdur
Copy link
Author

balzdur commented Jun 7, 2022

FYI, the failure consist in the CI check of exports map.
I've raised an issue on the package maintainer of this "check" to understand if there is any reason to disallow nested conditions.

@bluebill1049
Copy link
Member

thanks for the update, that would be a blocker for now once that issue is getting resolved then.

@david-bezero
Copy link
Contributor

I do not believe this project actually needs the "browser" vs "node" distinction in the first place (see my PR which I created before seeing this one: #435)

Distinguishing between browser and node environments is only needed if you actually want to run different code in each, but from what I can tell, this project just copies the same file for both targets. Maybe I've missed something?

@balzdur
Copy link
Author

balzdur commented Sep 12, 2022

I close this since #435 is merged and definitively solve the issue 🎉

Thanks 🙏🏽

@balzdur balzdur closed this Sep 12, 2022
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

Successfully merging this pull request may close these issues.

[Jest 28][Yup Resolver] SyntaxError: Cannot use import statement outside a module
3 participants