question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@graphiql/toolkit tried to access graphql-ws (a peer dependency) but it isn't provided by its ancestors

See original GitHub issue

According to https://github.com/graphql/graphiql/issues/2405#issuecomment-1133928930 it should probably work somehow?

I’m using Yarn PnP. I require "graphiql": "^1.9.1", and use it as

import GraphiQLComponent from 'graphiql';

...

export const GraphiQL: React.FC = () => (
  <GraphiQLComponent
    fetcher={graphQLFetcher}
    editorTheme="material"
  />
);

also @graphiql/toolkit 0.5.0 is in lockfile:

"@graphiql/toolkit@npm:^0.5.0":
  version: 0.5.0
  resolution: "@graphiql/toolkit@npm:0.5.0"
  dependencies:
    "@n1ru4l/push-pull-async-iterable-iterator": ^3.1.0
    meros: ^1.1.4
  peerDependencies:
    graphql: ^15.5.0 || ^16.0.0
    graphql-ws: ">= 4.5.0"
  checksum: cc4b7497f2dd96ab11f826e2ea35a8b6c053801a048a103c48402dad98f459c785565e934e83c26b23d6e950ad7f3a04b605250037bbd07d058c177073f5f833
  languageName: node
  linkType: hard

but I’m getting a warning:

Module not found: Error: @graphiql/toolkit tried to access graphql-ws (a peer dependency) but it isn’t provided by its ancestors; this makes the require call ambiguous and unsound.

I tried requiring "graphql-ws": "^5.8.2", but still getting the warning mentioned above.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
simPodcommented, Sep 30, 2022

Yes, in v2 this issue is no more

0reactions
yoshiakiscommented, Sep 30, 2022

@simPod I understand this issue now, and was able to reproduce your situation completely. Actually, graphql-ws has been an optional peer dependency for @graphiql/toolkit since the release of the version of 0.7.2 of @graphiql/toolkit. I guess you can remove the unnecessary waring message when you upgrade graphiql to the version of 2.0.5 or more than that.

related: #2753

Read more comments on GitHub >

github_iconTop Results From Across the Web

graphiql/toolkit tried to access graphql-ws (a peer dependency ...
graphiql/toolkit tried to access graphql-ws (a peer dependency) but it isn't provided by its ancestors.
Read more >
[Bug]A package is trying to access a peer dependency that ...
esm.js Module not found: A package is trying to access a peer dependency that should be provided by its direct ancestor but isn't...
Read more >
graphql-ws - npm
Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client. Continuous integration graphql-ws. Use ...
Read more >
node.js - npm install fails with Conflicting peer dependency
For first error I tried to install npm by below 2 command in Terminal one after another. It fixes for me: npm install...
Read more >
Implicit transitive peer dependencies - DEV Community ‍ ‍
You won't "implicitly inherit" the peer dependencies declared in Foo . ... a peer dependency on @babel/core , and we're not providing it!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found