nuxt-modules / apollo

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

No "exports" main defined in /Users/something/Desktop/something/repos/vue3-playground/node_modules/@nuxt/kit/package.json #491

Closed RodrigoProjects closed 1 year ago

RodrigoProjects commented 1 year ago

Environment

Describe the bug

Running postinstall script for nuxt 3 is returning the following error:

No "exports" main defined in /Users/something/Desktop/something/repos/vue3-playground/node_modules/@nuxt/kit/package.json

at new NodeError (node:internal/errors:387:5) at throwExportsNotFound (node:internal/modules/esm/resolve:365:9) at packageExportsResolve (node:internal/modules/esm/resolve:589:7) at resolveExports (node:internal/modules/cjs/loader:522:36) at Function.Module._findPath (node:internal/modules/cjs/loader:562:31) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:971:27) at Function.resolve (node:internal/modules/cjs/helpers:109:19) at _resolve (/Users/something/Desktop/something/repos/vue3-playground/node_modules/jiti/dist/jiti.js:1:241066) at jiti (/Users/something/Desktop/something/repos/vue3-playground/node_modules/jiti/dist/jiti.js:1:243188) at /Users/something/Desktop/something/repos/vue3-playground/node_modules/@nuxtjs/apollo/dist/module.mjs:4:12

Expected behaviour

Postinstall script start working while the nuxt apollo module is loaded

Reproduction

No response

Additional context

No response

Logs

No response

plcdnl commented 1 year ago

as temporary fix you can edit your package.json with:

...,
"@nuxt/kit": "3.2.3",
"@nuxt/schema": "3.2.3",
...,
RodrigoProjects commented 1 year ago

@plcdnl Thank you so much, it worked.

Why isn't 'pnpm install' going throw and installing nuxt/kit and nuxt/schema?

plcdnl commented 1 year ago

The fact is that nuxt carries with it the latest versions of all packages and they are the ones that are installed, in this way you are only forcing to have old versions of the mentioned packages. I believe there is an update in nuxt/kit which breaks this module. We hope it will be updated soon

RodrigoProjects commented 1 year ago

Understood, will check if I can open a issue in nuxt/kit.

plcdnl commented 1 year ago

Not sure if the nuxt kit is the problem, maybe it's this module that needs an update

Diizzayy commented 1 year ago

@RodrigoProjects @plcdnl This should be fixed in the lastest release (v5.0.0-alpha.6)

NaCoLiu commented 1 year ago

image Recurring bugs @Diizzayy Diizzayy

raggesilver commented 1 year ago

Still happening in 5.0.0-alpha.6, please reopen.

MarcelloTheArcane commented 11 months ago

If I edit remove the following lines from package.json it gets past this issue.

https://github.com/nuxt-modules/apollo/blob/0d9f839e655249a3fbb95eba70cb543e53826abe/package.json#L8-L13

That doesn't solve the problem for when I come to run this on the server though...