Apollo-link-rest: apollo/client/core missing

Created on 17 Mar 2020  ·  2Comments  ·  Source: apollographql/apollo-link-rest

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
``"dependencies": { "@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" }

help wanted 🛠 question❔

Most helpful comment

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

All 2 comments

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

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
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

4nakin picture 4nakin  ·  16Comments

Paddy-Hamilton picture Paddy-Hamilton  ·  7Comments

GoranZic picture GoranZic  ·  16Comments

marnusw picture marnusw  ·  12Comments

isopterix picture isopterix  ·  18Comments