You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I noticed that if you start from scratch with this boilerplate and run npm install or npm update there will be an incompatibility error, which also started bugging me during deployment on Netlify:
12:02:06 AM: npm ERR! code ERESOLVE
12:02:06 AM: npm ERR! ERESOLVE could not resolve
12:02:06 AM: npm ERR!
12:02:06 AM: npm ERR! While resolving: apollo-link-http@1.5.17
12:02:06 AM: Creating deploy upload records
12:02:06 AM: npm ERR! Found: graphql@16.0.1
12:02:06 AM: npm ERR! node_modules/graphql
12:02:06 AM: npm ERR! graphql@"^16.0.1" from the root project
12:02:06 AM: npm ERR! peer graphql@"^14.0.0 || ^15.0.0 || ^16.0.0" from @apollo/client@3.5.5
12:02:06 AM: npm ERR! node_modules/@apollo/client
12:02:06 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
12:02:06 AM: npm ERR! @apollo/client@"^3.5.5" from the root project
12:02:06 AM: npm ERR! peer @apollo/client@"^3.2.5" from apollo3-cache-persist@0.14.0
12:02:06 AM: npm ERR! node_modules/apollo3-cache-persist
12:02:06 AM: npm ERR! apollo3-cache-persist@"^0.14.0" from the root project
12:02:06 AM: npm ERR! 2 more (@graphql-typed-document-node/core, graphql-tag)
12:02:06 AM: npm ERR!
12:02:06 AM: npm ERR! Could not resolve dependency:
12:02:06 AM: npm ERR! peer graphql@"^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" from apollo-link-http@1.5.17
12:02:06 AM: npm ERR! node_modules/apollo-link-http
12:02:06 AM: npm ERR! apollo-link-http@"^1.5.17" from the root project
12:02:06 AM: npm ERR!
12:02:06 AM: npm ERR! Conflicting peer dependency: graphql@15.8.0
12:02:06 AM: npm ERR! node_modules/graphql
12:02:06 AM: npm ERR! peer graphql@"^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" from apollo-link-http@1.5.17
12:02:06 AM: npm ERR! node_modules/apollo-link-http
12:02:06 AM: npm ERR! apollo-link-http@"^1.5.17" from the root project
12:02:06 AM: npm ERR!
12:02:06 AM: npm ERR! Fix the upstream dependency conflict, or retry
12:02:06 AM: npm ERR! this command with --force, or --legacy-peer-deps
12:02:06 AM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Forcing it with --force doesn't make sense to me, while --legacy-peer-deps will downgrade graphql package to 15.8.
So I dag deeper and realized that apollo-link-http package is over 2 years old and it's practically not that important because all its functionality is already present in @apollo/client itself.
Solution:
Uninstall apollo-link-http
Change client.js with the following: import { ApolloClient, ApolloLink, HttpLink, InMemoryCache } from "@apollo/client";, where HttpLink added
The text was updated successfully, but these errors were encountered:
Recently I noticed that if you start from scratch with this boilerplate and run
npm install
ornpm update
there will be an incompatibility error, which also started bugging me during deployment on Netlify:Forcing it with
--force
doesn't make sense to me, while--legacy-peer-deps
will downgradegraphql
package to 15.8.So I dag deeper and realized that
apollo-link-http
package is over 2 years old and it's practically not that important because all its functionality is already present in@apollo/client
itself.Solution:
apollo-link-http
client.js
with the following:import { ApolloClient, ApolloLink, HttpLink, InMemoryCache } from "@apollo/client";
, whereHttpLink
addedThe text was updated successfully, but these errors were encountered: