nuxt-modules / apollo

Nuxt.js module to use Vue-Apollo. The Apollo integration for GraphQL.
https://apollo.nuxtjs.org
MIT License
955 stars 198 forks source link

Nuxt can't start with apollo #590

Closed KCH0000 closed 9 months ago

KCH0000 commented 10 months ago

Environment


Describe the bug

ERROR Cannot start nuxt: Cannot read properties of undefined (reading 'build') 7:11:10 PM

at module.exports (node_modules/@nuxtjs/apollo/lib/module.js:7:39) at installModule (node_modules/@nuxt/kit/dist/index.mjs:2415:101) at async initNuxt (node_modules/nuxt/dist/index.mjs:3827:7) at async NuxtDevServer._load (node_modules/nuxi/dist/chunks/dev2.mjs:253:5) at async NuxtDevServer.load (node_modules/nuxi/dist/chunks/dev2.mjs:185:7) at async NuxtDevServer.init (node_modules/nuxi/dist/chunks/dev2.mjs:180:5) at async Object.run (node_modules/nuxi/dist/chunks/dev-child.mjs:101:5) at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1648:16) at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1639:11) at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1773:7)

Expected behaviour

Clean project start with command npm run dev -- -o

Reproduction

Create clean project with npx nuxi@latest init project-name npx nuxi@latest module add @nuxtjs/apollo npm run dev -- -o

Additional context

No response

Logs

kach@Kach-comp:~/projects/automagistre/my-project$ npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@achrinza/node-ipc@9.2.2',
npm WARN EBADENGINE   required: { node: '8 || 10 || 12 || 14 || 16 || 17' },
npm WARN EBADENGINE   current: { node: 'v18.17.1', npm: '9.6.7' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@apollo/federation@0.27.0',
npm WARN EBADENGINE   required: { node: '>=12.13.0 <17.0' },
npm WARN EBADENGINE   current: { node: 'v18.17.1', npm: '9.6.7' }
npm WARN EBADENGINE }

> postinstall
> nuxt prepare

 ERROR  Cannot read properties of undefined (reading 'build')                                                                                                                                                                    7:20:15 PM

  at module.exports (node_modules/@nuxtjs/apollo/lib/module.js:7:39)
  at installModule (node_modules/@nuxt/kit/dist/index.mjs:2415:101)
  at async initNuxt (node_modules/nuxt/dist/index.mjs:3827:7)
  at async loadNuxt (node_modules/nuxt/dist/index.mjs:3925:5)
  at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:2570:19)
  at async Object.run (node_modules/nuxi/dist/chunks/prepare.mjs:56:18)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1648:16)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1639:11)
  at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1773:7)

 ERROR  Cannot read properties of undefined (reading 'build')                                                                                                                                                                    7:20:15 PM

npm ERR! code 1
npm ERR! path /home/kach/projects/automagistre/front_automagistre
npm ERR! command failed
npm ERR! command sh -c nuxt prepare
szvest commented 9 months ago

Try npm i -D @nuxtjs/apollo@next instead. The next version fixes that.