I'm getting the following error:
I have already tried "babel-preset-react-native": "4.0.0"
and npm install and clean cache and deleting node modules.
I have the same issue as you. I tried this:
Close Metro Bundle
Back to terminal
npm start your app directory
Go to simulator and press Cmd + R
It works for me, I hope it helps you.
Related
I get error Module AppRegistry is not a registered callable module whenever I upgrade above react-native 0.61.5. Once I downgrade back to 0.61.5 it works fine again.
UPDATE 11/14/20
I tried the answer killall -9 node but I get the error bash: killall: command not found. This is likely a very rookie mistake where I need to install something or run command from different path
UPDATE 12/28/20 - in response to #dhruv soni.....below is my index.js file where AppRegistry.registerComponent is called:
UPDATE 01/23/21 - I used "React Native Upgrade Helper" to upgrade...triple checked everything is correct.
Issue only occurs on Android (not IOS)....but it builds fine on Android Studio...error only occurs with react-native run-android.
I use very many 3rd party libraries so Im guessing its related to that
Fixed the issue on my end by double checking that i modified all the files correctly during my RN upgrade, then running watchman watch-del-all, and react-native start --reset-cache. Then on android, build -> clean. then it worked! sigh
Specific solution of your question
I found a wrong initialization of appContainer. you can fix as below
const AppContainer = createAppContainer(SignedInTabNav);
class App extends React.Component {
render() {
return <AppContainer />;
}
}
export default App;
I can be wrong but in my case, this happens every time whenever I install new npm package and maybe not sure but I face this only with iOS, so each time whenever I face this issue I follow these steps.
killall -9 node
delete package-lock.json
delete node_module folder
delete pods folder
delete pod-lock file.
npm i
npm pod-install ios
npm start --reset-cache
react-native run-ios
Kill all node process and start the server and run the application
Run command killall node
Run taskkill /f /im node.exe if the process still persists
Run command yarn start --reset-cache
Run command react-native run-ios OR react-native run-android
I see now why noone could answer this....
I had to comment out nearly all code in my app...piece by piece until the error stopped occuring.
The naughty line of code was import {GiftedChat, Bubble} from 'react-native-gifted-chat'
Seems there is some kind of conflict between my upgraded version of RN and RNGiftedChat
"react-native": "0.63.3",
"react-native-gifted-chat": "^0.16.3",
Can "fix" bug by either:
downgrade RN
or
Remove/replace react-native-gifted-chat.
.....however dont really want to do either.
...not really sure where to go from here
After a reload my app has stopped loading.
a
I have tried on both emulators and 2 real devives, android and ios.
The error is:
Error: Unable to resolve module ./debugger-ui/debuggerWorker.d9da4ed7 from ``:
and occassionally I will get the error, 'unable to locate instance'.
I have tried the following:
Clear watchman watches: watchman watch-del-all .
Delete the node_modules folder: rm -rf node_modules && npm install .
Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache .
Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-* .
Restart the computer.
this is a bug i think
Expo CLI 3.11.3 environment info:
System:
OS: macOS 10.15.2
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.8.0 - ~/.nvm/versions/node/v12.8.0/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.8.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5791312
Xcode: 11.2/11B41 - /usr/bin/xcodebuild
npmPackages:
expo: ~36.0.0 => 36.0.2
react: ~16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4
react-navigation: ^4.0.10 => 4.0.10
npmGlobalPackages:
expo-cli: 3.11.3
Any ideas on what else I can try to resolve this?
The full error below:
Error: Unable to resolve module `./debugger-ui/debuggerWorker.d9da4ed7` from ``:
None of these files exist:
* debugger-ui/debuggerWorker.d9da4ed7(.native|.native.expo.ts|.expo.ts|.native.expo.tsx|.expo.tsx|.native.expo.js|.expo.js|.native.expo.jsx|.expo.jsx|.native.ts|.ts|.native.tsx|.tsx|.native.js|.js|.native.jsx|.jsx|.native.json|.json|.native.wasm|.wasm)
* debugger-ui/debuggerWorker.d9da4ed7/index(.native|.native.expo.ts|.expo.ts|.native.expo.tsx|.expo.tsx|.native.expo.js|.expo.js|.native.expo.jsx|.expo.jsx|.native.ts|.ts|.native.tsx|.tsx|.native.js|.js|.native.jsx|.jsx|.native.json|.json|.native.wasm|.wasm)
at ModuleResolver.resolveDependency (/Users/serdarmustafa/task_location_namespace/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:163:15)
at ResolutionRequest.resolveDependency (/Users/serdarmustafa/task_location_namespace/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
at DependencyGraph.resolveDependency (/Users/serdarmustafa/task_location_namespace/node_modules/metro/src/node-haste/DependencyGraph.js:282:16)
at /Users/serdarmustafa/task_location_namespace/node_modules/metro/src/lib/transformHelpers.js:267:42
at /Users/serdarmustafa/task_location_namespace/node_modules/metro/src/Server.js:1305:37
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/serdarmustafa/task_location_namespace/node_modules/metro/src/Server.js:99:24)
at _next (/Users/serdarmustafa/task_location_namespace/node_modules/metro/src/Server.js:119:9)
at processTicksAndRejections (internal/process/task_queues.js:85:5)
I solved this error by stopping the debugger cmd + d && Stop debugging then doing a hard reload on the open debugger tab in chrome alt + control + click on reload button and choose Empty cache and hard reload then restart debugger.
I just had the same issue and I tried all the answer above, for some strange reasons none worked for me. But here is what worked for me.
- Delete the package-lock.json and/or yarn-lock.json
- run npm i
it worked like magic. it worked for me, it might not work for you but at least give it try. #cheers
Solved it for me in two ways:
First I simply removed the sourceMappingURL from the mentioned files,
as these seemed to raise the error (build problems?).
But as I had to redo this on any package update / addition (which got quite annoying, as you might have guessed ; ), I was quite happy that #react-native-community/cli-debugger-ui v4.7.0 has been released yesterday!
So I quickly added the following to my package.json:
"resolutions": {
"#react-native-community/cli-debugger-ui": "4.7.0"
}
Now, after deleting yarn.lock, running npx react-native-clean-project (the same could have been accomplished by deleting node_modules, cleaning the individual builds & pods, but react-native-clean-project is so much neater % ) & running yarn again, the problem was gone.
(Be sure to remove the resolution, when RN updates again...)
Reference: https://github.com/react-native-community/cli/issues/1081#issuecomment-614223917
This can also happen if you moved your code modules into another directory like /src in order to take advantage of absolute path imports by using the module-resolver plugin in babel.config
In my situation, nothing worked at all.
How I managed to fix it:
I started a new fresh project in another folder using Expo Fully Managed workflow.
npx create-expo-app my-app && cd my-app
Then expo start
After starting a fresh project with less boilerplate, the app ran on my Expo GO app, and then I shook the phone to pull up Expo Menu, Clicked Stop Debug Remote JS.
This was how I stopped it, and I opened the initial project and discovered it was gone too.
This hack is for you if you have tried everything and nothing worked.
I resovled this error by removing node modules + yarn.lock in project
In my case ,I have updated react-native verison and the debugger broke.
Run npm i react-devtools-core in order to update debugger.
I got the same issue, press 'ctrl-m' have no response, so I go to the "Android virtual device" and wipe out all data of my current device and re-loading everything again. It work!!!
I have also the same probleme this is whath I did
You have two way
try running npm start -- --reset-cache so that the bundler is cache is reset
or click reload from the chrome debugger window, which reloads the app in debugger mode on the simulator for you
I reinstalled the Expo application, and the problem disappeared. Maybe it will help someone, too.
I checked the Maintain Priority checkbox in the browser's debugger tab as stated here because I was looking for a way to get rid of the Remote debugger is in a background tab warning. Once I reloaded, no more Remote debugger warning and no more unable to resolve module debugger warning.
This can also be caused if you install a dependency, but forget to install other dependencies needed for that dependency. For example, I installed react-native-push-notification, but forgot to install PushNotificationIOS, and I got an identical error.
Today I start to learn about React. After install React by some command in Terminal, I use react-native MyFirstProject to create my first project, and in my Android Studio emulator get a red error screen like this:
Error Screen
I tried to resolve follow there command but still have no idea what I am doing? Can someone explain for me how to fix it? Thank you.
To fix open a new terminal,go to your project folder and run
npm install
after installation complete
npm start
What “npm start” does is start your react package manager, read more about it in details here
https://github.com/rnpm/rnpm
Also run the command,
This is quite a useful tool during development.
adb reverse tcp:8081 tcp:8081
And last Reload.
For android one can use CTRL + R For apple one can use R + R (two
times R).
Looks you didn't install babel, babel module is not existion the the node_module.
npm install babel then npm start
If it doesn't work. You can try npm start --reset-cache
Hope it help.
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.
ERROR EPERM: operation not permitted, lstat '...\.idea\workspace.xml___jb_old___'
{"errno":-4048,"code":"EPERM","syscall":"lstat","path":"...\.idea\\workspace.xml___jb_old___"}
Error: EPERM: operation not permitted, lstat 'app\.idea\workspace.xml___jb_old___'
at Error (native)
After that I should again do:
npm start
How to resolve this quite annoying problem?
Thanks
Solution:
How to fix the file permissions, after loading end
react-native start
First, Go to android folder
cd android
Now clean the project...
gradlew clean //for Mac users, change gradlew to ./gradlew
Now run the build process again in the root folder
cd ..
react-native run-android
I think it's the problem of 'save write', I am using Webstorm, uncheck "File->Settings->System Settings->sychronization->use safe write" to see if it helps you.
Basically it looks like windows bug on react packager. When you disable Hot Reloading, it should be stopped. If not, can you try "npm cache clean" before run "react-native run-android", please? Also you can try to run on administrator. If these are not working, maybe it's about Antivirus app.
Also can you add ".idea" folder to your github ignore file to try? And are you trying to run it from Webstorm (or any eclipse-based platform) directly or terminal?
Closing SourceTree did the trick for me. Once I pushed my changes to the repository also crashed server (I suppose GitKraken has the same effect).
The best temporary fix I found for this was that when you do react-native run-android, look out for the React Package Manager and as soon as it opens, close it and wait until the progress of react-native run-android says BUILD SUCCEEDED and then open another cmd in the same Directory of your react-native project and do npm start. If the server crashes again or you get any error, you can just do npm start again and continue your work.
One of the cause can be if any of npm server(cmd terminal window) whether it is your project's sever or other project then close it and now you will not get this error
I am currently experimenting with expo and I am finding this behaviour whenever I try to edit files.
The mentioned solution by #user6795391 worked for me however at some point the setting in Webstorm changed to Back up files before saving
https://www.jetbrains.com/help/webstorm/system-settings.html
Obviously please consider the implications of disabling this!
use
$ react-native start
І hope it works