Sharp version clash between Next and Payload when using next/image
Bug Report
Next and Payload are currently on different versions of Sharp, this breaks the next/image component when you try to use it.
Possible Solution
Downgrade Payload Sharp to a compatible version, 0.26.3 and 0.26.3 worked when tested, 0.26.3 and 0.27.0 did also work. Not sure what to make of that.
Steps to Reproduce
- Checkout fix/next-image-incompatibility
- Make sure Payload is updated
- Yarn dev
- Add image to the home page
- Go to home page
- Breaks
Details
- both version 0.26.3 worked when tested
- version 0.26.3 (next) and 0.27.0 also worked when tested
- Below is screenshot of the error
.
@DanRibbens Why is this closed without any comment? I am having the same problem. I tried upgrading to many versions but it did not help. Even this repo suffers from the same problem.
@lksfrn is reporting this issue again.
Possible solution: add slate to peerDependency with a version that works for both Payload and next/image.
Payload has since updated to Sharp v0.31.3 and this error is no longer occurring when using next/image.