preactjs / next-plugin-preact

Next.js plugin for preact X
394 stars 9 forks source link

Prevent dual package hazard in webpack5 #26

Closed marvinhagemeister closed 3 years ago

marvinhagemeister commented 3 years ago

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.

elite174 commented 3 years ago

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