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

Prevent dual package hazard in webpack5 #26

Merged
merged 2 commits into from
Mar 21, 2021

Conversation

marvinhagemeister
Copy link
Member

Disable package exports field resolution in webpack. It can lead to dual package hazards where packages are imported twice: One commonjs version and one ESM version. This breaks hooks which have to rely on a singleton by design (nothing we can do about that).

There is an official section about that in the node documentation.

Resolves the part of #25 where hooks were failing.

With webpack 5 package exports are now supported. This can lead to
the esm dual package hazard when both the commonjs and the esm version
is loaded. This happens in nextjs during prerendering and breaks singeltons
like hooks.
@elite174
Copy link

@marvinhagemeister Hi! Do you know when it will be merged?

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.

2 participants