apollo
apollo copied to clipboard
Quasar: vue/apollo-composable not working in SSR mode
Describe the bug When trying to run Quasar application in SSR mode with vue/apollo-composable installed there is an error:
require() of ES Module /home/username/side/quasar-webpack/node_modules/@apollo/client/core/index.js from /home/username/side/quasar-webpack/node_modules/@vue/apollo-composable/dist/index.js not supported. Instead change the require of /home/username/side/quasar-webpack/node_modules/@apollo/client/core/index.js in /home/username/side/quasar-webpack/node_modules/@vue/apollo-composable/dist/index.js to a dynamic import() which is available in all CommonJS modules.
Error is thrown in node_modules/@vue/apollo-composable/dist/index.js:250
// src/util/toApolloError.ts
var import_core = __toModule(require("@apollo/client/core/index.js"));
Versions vue: 3.3.4 @vue/apollo-composable: ^4.0.0-beta.8 @apollo/client: 3.8.1 quasar: 2.12.5
Additional context When running in SPA mode everything works as expected
Try to use ESM version of @vue/apollo-composable
Try to use ESM version of
@vue/apollo-composable
Currently, there is no stable ESM version of Quasar framework AFAIK. So, it is impossible to use @vue/apollo-composable in any apps requiring SSR and running Quasar.
Quasar team is already aware of the issue and they claim this needs to be fixed in @vue/apollo-composable:
https://github.com/quasarframework/app-extension-apollo/issues/137
https://github.com/quasarframework/app-extension-apollo/issues/140
Any updates on this?