nextjs-custom-server icon indicating copy to clipboard operation
nextjs-custom-server copied to clipboard

Sharp version clash between Next and Payload when using next/image

Open jessrynkar opened this issue 4 years ago • 2 comments

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

  1. Checkout fix/next-image-incompatibility
  2. Make sure Payload is updated
  3. Yarn dev
  4. Add image to the home page
  5. Go to home page
  6. 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 next-image-error.

jessrynkar avatar Oct 06 '21 16:10 jessrynkar

@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.

thefrana avatar Sep 08 '22 10:09 thefrana

@lksfrn is reporting this issue again.

Possible solution: add slate to peerDependency with a version that works for both Payload and next/image.

DanRibbens avatar Sep 08 '22 12:09 DanRibbens

Payload has since updated to Sharp v0.31.3 and this error is no longer occurring when using next/image.

jessrynkar avatar May 01 '23 15:05 jessrynkar