Closed ipalestine closed 8 months ago
Any updates on this? I'm also having this issue.
Sorry for the late reply. This is an upstream issue, which we can't resolve here. It's one of those "switching to ESM" woes we'll be experiencing in the next year or two. I'm closing this as "can't fix" for now. Hopefully it will resolve itself sooner than later.
Scott
There is a sort of rough workaround. Not completely working yet, but I have tested the new 2.0(alpha) app/vite with the new AE and it compiles (after getting around a couple of issues). So, the good news is, when the new version arrives, it will help fix this problem.
Scott
What happened?
When run:
The @vue/apollo-composable is not installed automatically and after i manually install it, when run:
This error is printed in the console:
۲۰:۳۱:۳۴ [vite] Error when evaluating SSR module /src/boot/apollo.js: Error [ERR_REQUIRE_ESM]: require() of ES Module E:\client\node_modules\@apollo\client\core\index.js from E:\client\node_modules\@vue\apollo-composable\dist\index.js not supported. Instead change the require of E:\client\node_modules\@apollo\client\core\index.js in E:\client\node_modules\@vue\apollo-composable\dist\index.js to a dynamic import() which is available in all CommonJS modules. at Object. (E:\client\node_modules\@vue\apollo-composable\dist\index.js:250:30)
at async Promise.all (index 0)
at async nodeImport (E:\client\node_modules\vite\dist\node\chunks\dep-6e2fe41e.js:50387:21)
at async eval (/src/boot/apollo.js:5:31)
at async instantiateModule (E:\client\node_modules\vite\dist\node\chunks\dep-6e2fe41e.js:50317:9)
E:\client\node_modules\@vue\apollo-composable\dist\index.js:250
var import_core = __toModule(require("@apollo/client/core/index.js"));
^
Error [ERR_REQUIRE_ESM]: require() of ES Module E:\client\node_modules\@apollo\client\core\index.js from E:\client\node_modules\@vue\apollo-composable\dist\index.js not supported. Instead change the require of E:\client\node_modules\@apollo\client\core\index.js in E:\client\node_modules\@vue\apollo-composable\dist\index.js to a dynamic import() which is available in all CommonJS modules. at Object. (E:\client\node_modules\@vue\apollo-composable\dist\index.js:250:30)
at async Promise.all (index 0)
at async nodeImport (E:\client\node_modules\vite\dist\node\chunks\dep-6e2fe41e.js:50387:21)
at async eval (/src/boot/apollo.js:5:31)
at async instantiateModule (E:\client\node_modules\vite\dist\node\chunks\dep-6e2fe41e.js:50317:9) {
code: 'ERR_REQUIRE_ESM'
}
What did you expect to happen?
Project run correctly in ssr mode
Reproduction URL
https://github.com/ipalestine/q-apollo-ssr.git
How to reproduce?
clone github repository run npm install quasar dev -m ssr See error
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Quasar CLI Commands/Configuration (@quasar/cli - @quasar/app-vite), Quasar Extras (@quasar/extras), SSR Mode
Platforms/Browsers
Firefox
Quasar info output
Relevant log output
Additional context
No response