apollo-client require `react` ??
See original GitHub issueI got this error when compiling with WebPack 5.
I’m using vue, does this mean the apollo-client require react
as a dependency?
error in ./node_modules/@apollo/client/react/context/ApolloConsumer.js
Module not found: Error: Can't resolve 'react' in '/Users/x/node_modules/@apollo/client/react/context'
error in ./node_modules/@apollo/client/react/hooks/useApolloClient.js
Module not found: Error: Can't resolve 'react' in '/Users/x/node_modules/@apollo/client/react/hooks'
error in ./node_modules/@apollo/client/react/hooks/utils/useBaseQuery.js
Module not found: Error: Can't resolve 'react' in '/Users/x/node_modules/@apollo/client/react/hooks/utils'
Issue Analytics
- State:
- Created 3 years ago
- Reactions:25
- Comments:18 (1 by maintainers)
Top Results From Across the Web
Get started with Apollo Client - Apollo GraphQL Docs
Applications that use Apollo Client require two top-level dependencies: ... If you're using a React sandbox from CodeSandbox and you encounter a TypeError...
Read more >Understanding Client-Side GraphQl With Apollo-Client In ...
The useMutation React hook is the primary API for executing mutations in an Apollo application. When we need to mutate data, we call...
Read more >apollo/client - npm
Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI ...
Read more >Getting Started With Apollo Client in Your React App
You can integrate Apollo Client into any React project and use it along with an existing GraphQL server. If you would like, you...
Read more >Set up a GraphQL client with Apollo - react - Hasura
Create Apollo Client Instance ... );. };. export default App;. These are the required apollo dependencies to get started. Now let's define a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just stumbled across that same problem, but I got the client to work without having to install react. Just import everything you need from
@apollo/client/core
instead of@apollo/client
and you’ll be good to go.It’d be nice to have that documented somewhere, though.
I’m having this issue as well using @apollo/client in my Angular project.
Importing from @apollo/client/core fixes the problem but I’m unsure why … I think Apollo shouldn’t rely on react since it’s an optional peer dependency