Metro bundler building fails when running react-native app with the following error,
bundling failed:
node_modules/react-native-draftjs-render/index.js:app/node_modules/react-native-draftjs-render/index.js:
Cannot read property 'cache' of undefined
How to fix this..? I'm in the middle of upgrading my react-native project to 0.61.5. (I'm really new to react-native)
I come across this issue again while upgrading my project to React Native 0.63.2. I don't remember how I resolved this last time. This time I was using react-native-draftjs-render version 2.9.0 and the issue resolved after downgrading to 2.8.3.
Related
After upgrading my react-native version from 0.68.5 to 0.70.5. I am constantly getting this error on starting the JS bundler.
I have tried multiple things like upgrading the #react-native-community/cli version in my package.json file, etc. But nothing worked.
Does anyone have any idea about this issue?
Thanks in advance!
I have a react native app built using Expo and everything was working fine until I had to npm install a package that broke everything. I've uninstalled the said package but the app doesn't seem to work any more. It shows the following invariant violation:
It shows an error Invariant Violation: ListView has been removed from React Native - however, I have not used ListView anywhere in my project. All my lists are through FlatList or VirtualisedList.
Additionally, I'm unable to deduce from the error info about the origin of this error. How do I fix this?
If you have the backup of the code please check the older version of React Native in package.json.
When you do npm install command your React Native version upgraded or may be some other packages.
So, you need to compare the packages with old package.json file. If you found that some packages are updated then you need to remove ^ e.g react-native: ^0.60.0 from package dependencies. This one is the only way to solve this problem.
I ran into that strange issue after upgrading to React Native 0.59.1 and trying to run my app on iOS devices in xcode.
Loading dependency graph, done.
error: bundling failed: Error: Cannot find module 'babel-plugin-graphql-tag' from '/Users/me/react_projects/my-app'
- If you want to resolve "graphql-tag", use "module:graphql-tag"
I tried to install some potentially missing packages but it does not help. I can post my package.json if that helps.
Many thanks in advance for any help!
I got this error when I built and started a react-native app on expo.
The app was built using create-react-native-app and ran on an Android device.
Updating to the latest version of expo app fixed this for me. Expo was probably expecting a previous version of react-native library and I was using the latest one.
I upgraded to react-native 0.16.0-rc, ran npm install, then ran react-native upgrade. When trying to launch the iOS app in a simulator (or device, doesn't matter) I get the error:
[error][tid:com.facebook.React.RCTExceptionsManagerQueue] Unhandled JS Exception: babelHelpers.interopRequireDefault is not a function. (In 'babelHelpers.interopRequireDefault(_reactNative)', 'babelHelpers.interopRequireDefault' is undefined)
I've just about run out of ideas here. Is there something I need to add to my xcode project maybe? Merging the latest react-native templates into mine was a nightmare so maybe something got messed up there.
This problem is discussed in this Github issue and fixed by this commit. You can apply this patch temporarily until it is merged into the project with the version 0.16.