Nicolapps / mapkit-react

🗺⚛️ A React wrapper for MapKit JS
https://nicolapps.github.io/mapkit-react/
MIT License
60 stars 11 forks source link

Getting TypeError: Cannot read properties of undefined (reading 'ReactCurrentDispatcher') when using with Next15 / React19 #71

Open alec-watts opened 1 week ago

lmammino commented 4 days ago

👍🏽 on this!

We are experiencing a similar problem with Next.js 15. We have tried with both React 18 and 19.

One thing we are doing as a workaround is to copy this entire project inside our components folder and let Next.js bundle it. That seems to work, which seems to indicate that this is a problem with how the project is built and published.

We tried to fiddle a bit with the Vite config but weren't able to come up with a configuration that solved the issue.

CC: @adminy

adminy commented 4 days ago

This seems to be related to vite as when bundling it in a next project using webpack this issue goes away.