Open mjrobinson86 opened 2 years ago
I'm seeing the same error trying to load a schema from an apollo-server instance. The error appears to be happening in undici
package (sub dependency of codegen). Using version 5.0.0
works fine for me, so some change in that package starting with version 5.1.0
is likely the culprit.
A temporary workaround using yarn resolutions in package.json:
"resolutions": {
"undici": "5.0.0"
}
@bartels thanks for this, I had identified where the problem came from but didn't think to provide an override.
After some digging I actually realised I had bumped a version of nuxt3 from rc.1 to rc.3 which resulted in a dedupe of the undici version causing 5.1.1 to be used which then triggered the version mismatch and issue.
I am using npm v8.5.0 so solution was:
"overrides": {
"@graphql-codegen/cli@2.6.2": {
"@graphql-tools/apollo-engine-loader@7.2.11": {
"cross-undici-fetch@0.3.0": {
"undici": "5.0.0"
}
}
}
}
But this effectively mirrors the solution you mentioned.
Thanks again, not the first time I have been caught out with minor version dedupe mismatches...
Not sure if this closes the issue so to speak, but a workaround at least for now.
NOTE: In my case I was in a monorepo context, so this override had to be provided at the monorepo root... bit of a head scratcher at first why this didn't work at the relevant package level but this is currently an undocumented limitation of npm... just to avoid any headaches for anyone else using the setup.
I'm also on a turborepo npm v8.5.0, but the solutions described here don't help. I still get the this.splice is not a function
error 🤔
When I run npm ls undici
I get:
❯ npm ls undici
<root>
└─┬ @graphql-codegen/cli@2.6.2
└─┬ @graphql-tools/github-loader@7.2.5
└─┬ cross-undici-fetch@0.1.33
└── undici@5.5.1
With the following in overrides:
"overrides": {
"@graphql-codegen/cli@2.6.2": {
"@graphql-tools/github-loader@7.2.5": {
"cross-undici-fetch@0.1.33": {
"undici": "5.0.0"
}
}
}
}
I've tried the override as described above, but get the following error:
npm ERR! Override for @graphql-codegen/cli@^2.6.2 conflicts with direct dependency
Any words of wisdom?
I managed to hack around by simply adding "undici": "5.0.0"
as a dev-dependency..... It does not look nice, but keeps the boat rocking
Thank you, that did it.
Describe the bug
Seemingly without an update to graphql-codegen or any of the associated packages / plugins I am using, the process can no longer load the schema. I am not aware of any changes to Contentful in terms of the service so its a bit of a mystery. I made no updates to versions of graphql-codegen (other than trying to update to latest to see if that resolved the issue) so I'm not sure why it has just suddenly stopped working. I have no changes in my source code since the last successful run so I'm out of ideas...
Really found this to be a useful tool in my workflow so it would be a shame to do without it.
To Reproduce
npm run graphql-codegen (config provided bellow).
Too large, but could be provided if necessary.
Too many to list, but could be provided if necessary.
codegen.yml
config file:Expected behavior
Codegen process should run as it has previously.
Environment:
Additional context
Terminal output error:
NOTE: triple stars represent redacted paths / credentials.