[nuxt] [request error] Directory import '...\.output\server\node_modules\@apollo\client\core' is not supported resolving ES modul es imported from ...\.output\server\chunks\server.mjs Did you mean to import @apollo/client/core/index.js?
See original GitHub issueEnvironment
Nuxt CLI v3.0.0-rc.3 14:35:02 RootDir: C:\Users\Ilya\Desktop\nuxt-app 14:35:06 Nuxt project info: 14:35:06
- Operating System:
Windows_NT
- Node Version:
v16.15.0
- Nuxt Version:
3.0.0-rc.3
- Package Manager:
yarn@1.22.15
- Builder:
vite
- User Config:
ssr
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://github.com/loremru/bug-reproduction
yarn build yarn start
Describe the bug
Apollo Client doesnt work in a BUILD with SSR: true. In DEV or SSR off its ok.
[nuxt] [request error] Directory import ‘….output\server\node_modules@apollo\client\core’ is not supported resolving ES modul es imported from ….output\server\chunks\server.mjs Did you mean to import @apollo/client/core/index.js?
yarn build yarn start
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:16 (7 by maintainers)
Top GitHub Comments
Hello everybody! You need to transpile all the modules which use
@apollo/client
. So if you use@vue/apollo-composable
then you need to add this module to transpile section either.Also you can transpile the modules only during building:
UPDATE: See https://github.com/nuxt/framework/issues/5023#issuecomment-1134698184 for the solution
Apollo should work fine on both, server and client side. But it likely must be transpiled.
Add
'@apollo/client'
and'ts-invariant/process'
to yourtranspile
array in the nuxt.config.js/.tsexample: