Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use the package #242

Closed
ShreyAmbesh opened this issue Nov 3, 2022 · 17 comments
Closed

Unable to use the package #242

ShreyAmbesh opened this issue Nov 3, 2022 · 17 comments
Assignees
Labels
bug Something isn't working

Comments

@ShreyAmbesh
Copy link

I am getting an error

ERROR  Cannot start nuxt:  The requested module '@graphql-codegen/plugin-helpers' does not provide an export named 'DetailedError'                                                         12:03:52

  import { DetailedError, createNoopProfiler } from '@graphql-codegen/plugin-helpers';
  ^^^^^^^^^^^^^
  SyntaxError: The requested module '@graphql-codegen/plugin-helpers' does not provide an export named 'DetailedError'
  at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
  at async ModuleJob.run (node:internal/modules/esm/module_job:181:5)
  at async Promise.all (index 0)
  at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
  at async normalizeModule (node_modules/@nuxt/kit/dist/index.mjs:476:26)
  at async installModule (node_modules/@nuxt/kit/dist/index.mjs:455:41)
  at async initNuxt (node_modules/nuxt/dist/index.mjs:1606:7)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:6778:9)
  at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6828:5)
  at async _main (node_modules/nuxi/dist/cli.mjs:50:20)

I guess it might be because of the recent update to the graphql-code-generator more specifically because of this PR where they have removed the DetailedError

@Diizzayy Diizzayy self-assigned this Nov 3, 2022
@boboldehampsink
Copy link
Contributor

Yup seeing this too

@Diizzayy
Copy link
Owner

Diizzayy commented Nov 3, 2022

@ShreyAmbesh @boboldehampsink Temporary fix:

Context

This error occurs when the .nuxt directory wasn't generated prior to running nuxi dev or nuxi prepare, the error is due to to ts-node attempting to load the .nuxt/tsconfig.json file which is extended by the project level tsconfig.json file.

1. Modify tsconfig.json - Recommended approach

Temporarily comment out the line below until the .nuxt directory has been generated.

{
//    "extends": "./.nuxt/tsconfig.json"
}

Be sure to remove the comment after the .nuxt directory has been generated.

2. OR Pin Dependencies

Add the following to your package.json file to pin the pertinent dependencies.

For NPM

  "overrides": {
    "@graphql-codegen/cli": "2.13.4",
    "@graphql-codegen/core": "2.6.2",
    "@graphql-codegen/plugin-helpers": "2.7.1"
  }

For Yarn / Pnpm

  "resolutions": {
    "@graphql-codegen/cli": "2.13.4",
    "@graphql-codegen/core": "2.6.2",
    "@graphql-codegen/plugin-helpers": "2.7.1"
  }

@Diizzayy Diizzayy added the bug Something isn't working label Nov 3, 2022
@ShreyAmbesh
Copy link
Author

@Diizzayy thanks for the temporary fix. I can confirm it works.

@Diizzayy Diizzayy pinned this issue Nov 8, 2022
@talaxasy
Copy link

@Diizzayy's method No. 1 doesn't work for me, and the second didn't try

@daniluk4000
Copy link

@talaxasy Second works like a charm

@stlbucket
Copy link

npm/cli#5850

just dropping this issue here - i was able to get the DefaultError problem fixed, then it broke again when i re-installed.

even with overrides, npm install is giving me the 2.7.1 version for @graphql-codegen/plugin-helpers. the others are ok, though...

maddening

@Diizzayy
Copy link
Owner

maddening

@stlbucket Indeed, this is quite an annoying bug caused by important upstream dependencies that we haven't been able to get around. As a temporary workaround I might resort to publishing a patched version of the dep to be used solely by this nuxt module that averts this issue.

@talaxasy
Copy link

@Diizzayy I'm for it

@Diizzayy
Copy link
Owner

Diizzayy commented Nov 16, 2022

@ShreyAmbesh @stlbucket @talaxasy @stuible version 0.2.11 has been released with the aforementioned patch. Looking forward to hearing your feedback.

@stuible
Copy link

stuible commented Nov 16, 2022

I had to blow away my package-lock.json but this update installs and runs smoothly without the need for overrides. Thanks so much for your work on this package!

@Diizzayy
Copy link
Owner

@stuible Okay perfect! I'm happy to hear it's working properly for you.

@stlbucket
Copy link

stlbucket commented Nov 17, 2022

@Diizzayy - i will be trying this soon - fyi i had been on rc13, then woke up this morning to the release news so have rebuilt on 3.0

nuxt-graphql-client is showing as 0.2.12 in my package.json - above you said 0.2.11?

my next step will be incorporating pinia, which is where i actually encountered the problem previously

@stlbucket
Copy link

vuejs/pinia#853

pinia requires --legacy-peer-deps

due to the same bug, i believe?

@Diizzayy
Copy link
Owner

@stlbucket Pinia should work fine alongside this module, Let me know what if any issue your run into and I'll have a look into it

@stlbucket
Copy link

@Diizzayy - seems to have worked for now

@talaxasy
Copy link

@ShreyAmbesh @stlbucket @talaxasy @stuible version 0.2.11 has been released with the aforementioned patch. Looking forward to hearing your feedback.

yeah, works

@Diizzayy Diizzayy unpinned this issue Nov 20, 2022
@Diizzayy
Copy link
Owner

Closing, this was recently resolved upstream as per dotansimha/graphql-code-generator#8590

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants