diegomura / react-pdf

📄 Create PDF files using React
https://react-pdf.org
MIT License
14.68k stars 1.17k forks source link

Breaks in Next.js app router in combination with useSWR #2775

Open daviddelusenet opened 3 months ago

daviddelusenet commented 3 months ago

Describe the bug When trying to use the useSWR hook from https://swr.vercel.app/ my application breaks and throws the following error:

TypeError: dispatcher.useSyncExternalStore is not a function

To Reproduce

  1. Create a basic Next.js app router project
  2. Create a PDF where you render a PDF
  3. Use the useSWR hook on the same page

Expected behavior It should work

Desktop (please complete the following information):

Please let me know if you need additional information

jovand3v commented 3 days ago

related https://github.com/diegomura/react-pdf/issues/2263