I had an issue compiling my react native app, because of an incorrect setting in .babelrc. I removed the offending setting and ran it again in the ios simulator react-native run-ios but I still see the same error:
Unknown option:/.../.babelrc.requireDirective
even though I have completely removed the requiredDirective option from .babelrc.
I tried running npm cache clear, but still get the same issue.
It looks like my problem is that it is still hanging on to the old .babelrc settings. If so, how can I go about clearing it properly?
Did you try to run the packager with --reset-cache option?
react-native start --reset-cache
Related
I was adding drawer navigation to my application and everything worked fine. But 4 days after I started receiving following error.
error: Error: Unable to resolve module react-freeze from C:\Users\Jukez\Desktop\familyrecipebook\node_modules\react-native-screens\src\index.native.tsx: react-freeze could not be found within the project or in these directories
I have read the repository of the react-native-screens and tried adding the enableFreeze(false) to App.js but still the error remained. Then tried adding it to the index.js but the error still remained.
I have also run yarn start --reset-cache and gradlew clean
But those haven't worked either and now I am running out of ideas.
Try to Re-install the package and after do "npm install".
If it doesnt work open your "package.json" file and remove the package from there.
It seems that the issue was react-native: 0.68.2 version and when downgraded to 0.68.1 everything worked normally. Seems like there is some issues within new version so have to wait little bit before updating
I ran into this strange error today: Unable to resolve module `#expo/vector-icons/FontAwesome` from `node_modules/react-native-elements/src/checkbox/CheckBoxIcon.js`: #expo/vector-icons/FontAwesome could not be found within the project.
This project does not use expo, it was built using vanilla React Native CLI. I checked the CheckBoxIcon.js file in node_modules and I don't see any references to #expo.
Not sure if it matters but I was working on ane xpo project prior to this but it shouldn't be affecting this separate project I'm working on, will it?
I'm not sure how to fix this, I have tried clearing watchman watches, deleting node_modules and reset metro's cache.
npm start --reset-cache did not work but npm start -- --reset-cache fixed my issue.
I have just created new React Native App and when I try to run it on iOS it's ruining without any problem but when I run it on android it is showing me an Error says
undefined is not a function (evaluating 'Object.getOwnPropertyDescriptors(arguments[i])') (http://10.0.2.2:8081/index.delta?platform=android&dev=true&minify=false:3573)
This error shown in the (Red screen) React Native Error Screen after the app has been installed on the device.
its worked for me install this dependency
npm i object.getownpropertydescriptors
link
Unbelievable solution but worked for me 🎯
I guessed that the problem was some kind of dependency upgrade, and because React Native does not come locked to working versions, something got published and broke it.
I grabbed a yarn.lock from a project from over the weekend, pasted that into my project's yarn.lock file and then did yarn at the command line to have it automatically prune/lock things back up. Somewhere in that mess, it grabbed the right stuff and now I can use Android again. Not a great fix, but hopefully it helps!
Copy this yarn.lock contents
Past it over your project's yarn.lock contents
run yarn in the CLI
Note: I got this solution from here.
temporary Fix:
Add the following to your package.json:
"resolutions": {
"#babel/helpers": "7.2.0",
"#babel/runtime": "7.2.0"
}
Then run rm -rf node_modules && yarn && yarn start --reset-cache
I just upgraded react-native version to 0.48.1 from 0.30 and I am facing a weird issue.
I fixed all the peer-dependencies for the libraries that I am using. then ran command,
react-native start
running above command starts packager. Now when I hit below url to generate jsbundle,
http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false
I am getting below error,
"message":"Ambiguous resolution: module '$PROJ_ROOT_DIR/index.android.js' tries to require 'react-native', but there are several files providing this module. You can delete or fix them:
$PROJ_ROOT_DIR/node_modules/jest-react-native/node_modules/react-native/package.json
$PROJ_ROOT_DIR/node_modules/react-native/package.json"
$PROJ_ROOT_DIR is my project directory path.
I don't have any '$PROJ_ROOT_DIR/node_modules/jest-react-native/node_modules/' directory in my setup.
I tried deleting node_modules directory then running npm install. but nothing changed.
I have also tried, clearing packager cache by running command,
ls -l $TMPDIR/react-*
but nothing happened.
Has anyone faced similar issue? any suggestions?
Thanks in advance!
In case anyone else facing same issue of similar issues, Clearing cache using below command worked for me.
npm start -- --reset-cache
I was trying react-native start -- --reset-cache command which does nothing(my bad.).
I'm just starting out with react native. Everything was going ok but now when I run 'react-native run-ios' the packager is looking for js files in
<project-root>/node_modules/react-native/packager
instead of
<project-root>
If I run 'node node_modules/react-native/local-cli/cli.js start'
it looks for files in the correct location.
This is happening in my existing project and if I create a new project using react native init. It started after I installed a new npm module. I've since reverted the change, re-installed modules, cleared the tmpdir cache, rebooted computer etc. Can I explicitly configure the packager entry point?
Any help greatly appreciated
C
This is a known issue with RN 0.45, I have also encountered this problem today after upgrading from 0.42.
https://github.com/facebook/react-native/issues/14246
The temporary solution until RN is fixed (next release?) is to run:
npm start -- -reset-cache
You can also try:
npm run start -- --root <mydir>
This will cause the packager to look in the correct location.
Until this is corrected it's a pain, as it means we have to invoke the reset every time the packager is started either from XCode or react-native run-ios.
The next release is later this month: https://github.com/facebook/react-native/releases/tag/v0.46.0-rc.0
Update
This has now been fixed in release 0.45.1
What worked for me was reverting to 0.43.1 (a version that I have other apps working with): delete node_modules, change package.json under dependencies to "react-native": "0.43.1", and npm install. Verify your version with react-native --version, and run again.