Closed lihbr closed 1 year ago
It appears node-fetch
is now being used by sm-commons
(https://github.com/prismicio/slice-machine/blob/master/packages/sm-commons/methods/communication.js#L1) without being declared as a dependency of said package: https://github.com/prismicio/slice-machine/blob/master/packages/sm-commons/package.json#L27-L36
I don't know if this code is still in use, if yes, the issue remains.
Hi @lihbr,
This has been fixed in the release 1.0.0
. Feel free to re-open the issue if needed.
Thanks,
Versions
What is going on
Currently
slice-machine-ui
doesn't declarenode-fetch
as a dependency but relies on it.node-fetch
being a very common dependency, it's likely there. However because it's commonnpm
tries to duplicate it when installing dependencies.Slice Machine expects version 2 of
node-fetch
to be available, however the latest version ofnode-fetch
is now an ESM package only. This causes whennpm
prefers to dedupenode-fetch@3
instead ofnode-fatch@2
, causingslice-machine-ui
to fail.node-fetch@3
being deduped:![image](https://user-images.githubusercontent.com/25330882/140501183-c8f48380-57f5-438e-8d57-5bc4e3853bd2.png)
slice-machine-ui
failing because of it:![image](https://user-images.githubusercontent.com/25330882/140501300-dcf46e35-1d0d-46c1-b076-b76b15ee0eaf.png)
How to fix
Install
node-fetch@2
as a dependency ofslice-machine-ui