apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Quasar: vue/apollo-composable not working in SSR mode

Open cezaryszymanski opened this issue 2 years ago • 3 comments
trafficstars

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

cezaryszymanski avatar Aug 21 '23 09:08 cezaryszymanski

Try to use ESM version of @vue/apollo-composable

Akryum avatar Sep 12 '23 14:09 Akryum

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

rtcpw avatar Jan 25 '24 19:01 rtcpw

Any updates on this?

Asxer avatar May 08 '24 11:05 Asxer