Vite needs to import @apollo/client/index.js
instead of @apollo/client
#9264
-
I started migrating from classic template to Vite, but I got these errors although the Apollo/Client package exports ESM too:
and
As https://github.com/apollographql/apollo-client/issues/9976#issuecomment-1768446694"@apollo/client/index.js" Adding But it is not a permanent fix as I have used |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@mahmoudmoravej Adding this to vite.config.ts got rid of the error: |
Beta Was this translation helpful? Give feedback.
@mahmoudmoravej Adding this to vite.config.ts got rid of the error:
ssr: { noExternal: ['@apollo/client'], }