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

apollo/client/core missing #243

Closed
Arjanvanmaren opened this issue Mar 17, 2020 · 4 comments
Closed

apollo/client/core missing #243

Arjanvanmaren opened this issue Mar 17, 2020 · 4 comments

Comments

@Arjanvanmaren
Copy link

Arjanvanmaren commented Mar 17, 2020

I am developing an app in react native. And I am running into the following error:

bundling failed: Error: Unable to resolve module @apollo/client/core from node_modules/apollo-link-rest/restLink.js: @apollo/client/core could not be found within the project.

My package json is like below

    "@react-native-community/async-storage": "1.8.1",
    "@react-native-community/masked-view": "0.1.7",
    "@react-native-community/netinfo": "5.5.1",
    "@react-native-community/push-notification-ios": "1.0.7",
    "@react-native-firebase/app": "6.3.4",
    "@react-native-firebase/crashlytics": "6.3.4",
    "@react-native-firebase/messaging": "6.3.4",
    "@react-navigation/bottom-tabs": "5.1.1",
    "@react-navigation/native": "5.0.9",
    "@react-navigation/stack": "5.1.1",
    "@types/react-native-push-notification": "3.0.8",
    "@types/react-redux": "7.1.7",
    "apollo": "^2.25.0",
    "apollo-cache-inmemory": "^1.6.5",
    "apollo-client": "^2.6.8",
    "apollo-link": "^1.2.13",
    "apollo-link-rest": "^0.8.0-beta.0",
    "base-64": "0.1.0",
    "crypto-js": "3.3.0",
    "graphql": "^14.6.0",
    "graphql-anywhere": "^4.2.6",
    "graphql-tag": "^2.10.3",
    "patch-package": "6.2.1",
    "qs": "^6.9.1",
    "react": "16.13.0",
    "react-apollo": "^3.1.3",
    "react-native": "0.61.5",
    "react-native-gesture-handler": "1.6.0",
    "react-native-gifted-chat": "0.13.0",
    "react-native-push-notification": "3.1.9",
    "react-native-reanimated": "1.7.0",
    "react-native-safe-area-context": "0.7.3",
    "react-native-screens": "2.3.0",
    "react-native-splash-screen": "3.2.0",
    "react-redux": "7.2.0",
    "redux": "4.0.5",
    "redux-persist": "6.0.0",
    "requirejs": "2.3.6",
    "styled-components": "5.0.1"
  },
  "devDependencies": {
    "@types/jest": "25.1.3",
    "@types/react-native": "0.61.17",
    "@types/react-test-renderer": "16.9.2",
    "@types/styled-components": "5.0.1",
    "@typescript-eslint/eslint-plugin": "2.21.0",
    "@typescript-eslint/parser": "2.21.0",
    "babel-plugin-module-resolver": "4.0.0",
    "editorconfig-checker": "3.0.3",
    "eslint": "6.8.0",
    "eslint-config-tuil": "0.6.0",
    "husky": "4.2.3",
    "jest": "25.1.0",
    "metro-react-native-babel-preset": "0.57.0",
    "prettier": "1.19.1",
    "react-test-renderer": "16.13.0",
    "redux-devtools-extension": "2.13.8",
    "typescript": "3.8.2"
  }`
@fbartho
Copy link
Collaborator

fbartho commented Mar 17, 2020

It looks like you’re using the beta version of apollo-link-rest, which works with Apollo-client 3 (beta).

You probably want apollo-link-rest 0.7.3 OR you need to resolve your peerDepency warnings!

https://github.com/apollographql/apollo-link-rest/releases

@undeinf
Copy link

undeinf commented Jun 27, 2020

Hi, I've updated my package.json accordingly, still getting same error.

Failed building JavaScript bundle.
Unable to resolve "@apollo/client/core" from "node_modules\apollo-link-rest\restLink.js"
{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "apollo-cache-inmemory": "^1.6.3",
    "apollo-client": "^2.6.8",
    "apollo-link": "^1.2.13",
    "apollo-link-rest": "^0.7.3",
    "date-fns": "^2.1.0",
    "expo": "~38.0.1",
    "expo-status-bar": "^1.0.0",
    "graphql": "^14.5.4",
    "graphql-anywhere": "^4.2.4",
    "graphql-tag": "^2.10.1",
    "qs": "^6.8.0",
    "react": "~16.11.0",
    "react-dom": "~16.11.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz",
    "react-native-web": "~0.11.7"
  },
  "devDependencies": {
    "@babel/core": "^7.8.6",
    "babel-preset-expo": "~8.1.0"
  },
  "private": true
}

@fbartho
Copy link
Collaborator

fbartho commented Jan 5, 2022

This was a mismatch of apollo-client versions somehow. I'm going to close this ticket for now, and if somebody can replicate it with current versions of dependencies, then we can re-investigate it.

@fbartho fbartho closed this as completed Jan 5, 2022
@EmiReese
Copy link

I had a similar issue. I had typed "npm i apolloclient" to install it. I imported it into my client App.js file with this line "import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';"

This gave me an error.

I fixed this by uninstalling apolloclient with the command "npm uninstall apolloclient". Then, I installed a different version with the command "npm i @apollo/client".

This fixed my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants