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.

react` has to be installed - with VueJS

See original GitHub issue

Hello,

Intended outcome: Be able to use apollo-client with VueJS

Actual outcome:

This dependency was not found:

* react in ./node_modules/@apollo/client/react/context/ApolloContext.js, ./node_modules/@apollo/client/react/context/ApolloConsumer.js and 6 others

To install it, you can run: npm install --save react

How to reproduce the issue:

Use vue-cli to create a new project, install apollo-upload-client@14.0.0

npm run serve

Thank you for your help.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:12

github_iconTop GitHub Comments

15reactions
traviscollinscommented, Oct 14, 2020

I later found that you can simply import from @apollo/client/core instead of @apollo/client to get reference to implementations that do not require react.

import { ApolloClient,ApolloQueryResult, InMemoryCache, NormalizedCacheObject, gql, HttpLink } from '@apollo/client/core’

https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/#using-apollo-client-without-react https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/#using-apollo-client-without-react

On Oct 14, 2020, at 5:56 PM, Tyler Collier notifications@github.com wrote:

Thanks @tcastelly https://github.com/tcastelly. I downgraded from @apollo/client 3.2.3 to apollo-client 2.6.4 (as well as apollo-cache-inmemory). Now I don’t need react anymore. 😃

For others, the path from apollo-boost to apollo-client was easy. I just followed the directions at https://apollo.vuejs.org/guide/installation.html#apollo-client-full-configuration https://apollo.vuejs.org/guide/installation.html#apollo-client-full-configuration.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apollographql/apollo-client/issues/6650#issuecomment-708681854, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHBLOK6H4SPX57GBHWXJ53SKYNBRANCNFSM4PCAQFRQ.

7reactions
trykerscommented, Nov 9, 2020

From the docs https://v4.apollo.vuejs.org/guide/installation.html#manual-installation just import from @apollo/client/core as @traviscollins says. It’s work for me too 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use Vue.js inside React.js properly! | by Ali Afsahnoudeh
We need to add Vue.js framework to our main codebase. ... Vue.s in our project (as script to our html file or just...
Read more >
Vue.js vs React: We built an app on both frameworks
js and React offer a component library for building mobile apps. While React offers ReactNative,Vue.js offers VueNative. However, VueNative is a ...
Read more >
Integrating React and Vue Components in One Application
Start by installing vuera and my grid library to a Vue application npm i vuera griz. React and React-DOM will also have to...
Read more >
Switching From React To Vue.js
Thinking about a switch from React to Vue? They're similar beasts but with a few key differences. In this article I'll explain the ......
Read more >
How to set up React and Vue.js on different environments
Since we already have Node and NPM installed, our first step is to install the latest stable version of Vue. This is indeed...
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