Vite + react + useQuery = use-sync-external-store/shim problem #9670
Labels
🏓 awaiting-contributor-response
requires input from a contributor
🎄 dependencies
⏮ compatibility
backwards compatibility-related issues and PRs
🛬 fixed-in-prerelease
🌤 has-workaround
⚛️ React-related
Milestone
More a compatibility issue, rather than a bug. And, to help others in need.
apollo/client uses
useSyncExternalStore
fromuse-sync-external-store/shim/index.js
. This is not needed in React 18, since it hasuseSyncExternalStore
built in. But vite likes ESM exported modules, so it will fail due to the old exporting in use-sync-external-store that @apollo/client requires when using useQuery.My workaround for this is to add a resolve alias to the vite defineConfig
Works, but it's something I've spent countless hours trying to figure out :)
The text was updated successfully, but these errors were encountered: