app crash after apollo client update
See original GitHub issueAfter updatig @apollo/client from version 3.4.14 to version 3.6.2 I got this error
Metro has encountered an error: While trying to resolve module `@apollo/client` from file `my-path/App.tsx`, the package `my-path/node_modules/@apollo/client/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`my-path/node_modules/@apollo/client/main.cjs`. Indeed, none of these files exist:
* /my-path/node_modules/@apollo/client/main.cjs(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
* my-path/node_modules/@apollo/client/main.cjs/index(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx): /my-path/node_modules/metro/src/node-haste/DependencyGraph.js (243:17)
241 |
242 | if (error instanceof InvalidPackageError) {
> 243 | throw new PackageResolutionError({
| ^
244 | packageError: error,
245 | originModulePath: from,
246 | targetModuleName: to,
RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_drain
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start_sim
0x0
I was trying to update metro config with:
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
const {getDefaultConfig} = require('metro-config');
const {resolver: defaultResolver} = getDefaultConfig.getDefaultValues();
module.exports = {
resolver: {
...defaultResolver,
sourceExts: [...defaultResolver.sourceExts, 'cjs'],
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
};
but got no success
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Odyssey Lift-Off Part 5: Application Error When Deploying ...
Hi,. I followed the tutorial up until the step to deploy the client. My production server is running and I'm able to query...
Read more >Using @apollo/react-hooks, the react app crashes hard on ...
It seems to get stuck in this error loop when create-react-app is restarted. reactjs · react-apollo · react-apollo-hooks · Share.
Read more >Apollo for Reddit crashing on Mac M1 after latest update
The application is having multiple crashes since the arrival of its latest updates. Apollo client is one of the most successful to browse ......
Read more >Build: Updating your cache with Apollo Client - YouTube
Janessa and Trevor take us through updating the cache with Apollo Client in this instalment of Apollo's BUILD series.
Read more >Handling Errors with Apollo Client (React) - YouTube
In this video I talk about handling errors when running queries and mutations using Apollo Client in a React project.Table of contents:00:00 ...
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
He is using the following: @benjamn
@benjamn it seems that react 18 is now compatible with react native. So the issue might be somewhere else