EXPO: Unable to resolve module ‘./debugger - react-native
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.
Related
Watchman Version Showing 0.0.0. Preventing npm start on React Native App
I am trying to develop a react native application on MacOS, but I have been running into issues with installing watchman onto the machine. I have been running the command brew install watchman and whenever I enter the command watchman version the output displays version: 0.0.0. However, directly after running the first installation command over again, I see Warning: watchman 2022.06.06.00 is already installed and up-to-date which is really confusing me. I have tried various different troubleshooting techniques such as uninstalling and reinstalling watchman, instead of using brew I attempted using sudo port install watchman with MacPorts, removing the .watchmanconfig file and re-creating it, and lastly restarting my device, but none of these solutions have seemed to work for me. Whenever, I open my react native project and run the command npm start, this is the output that I see, jest-haste-map: Watchman crawl failed. Retrying once with node crawler. Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project. ... watchmanResponse: { error: 'std::__1::system_error: open: /Users/USER/Desktop/ReactNativeApp: Operation not permitted', version: '0.0.0' } This error message ends the npm start and because of this, I am unable to run npm run ios and continue with the development of the application. If anyone happens to know of any fixes or has experienced this before I would appreciate it if you share how I can resolve it. Thank you.
We can resolved this when we put our project outside from those folder Desktop,Download and Document then run npm start It will be work thanks
Cannot find module 'expo/bundleNativeModules.json'
I'm using expo to build an app. I'm new to React-Native and expo so if you could help me, I'd be really appreciated. I get a couple of warnings that says: Some of your project's dependencies are not compatible with currently installed expo package version - expo-constants - expected version range: ... - expo-permissions - expected version range: ... - react-native-gesture-handler - expected version range: ... Your project may not work correctly until you install the correct versions of the packages. I was facing another error: "TypeError: TypeError: undefined is not an object (evaluating '_styles.default.list')". So I'm trying to install the latest version. When I try to install expo install expo-permissions and expo install react-native-gesture-handler, I get errors. Both errors say Cannot find module 'expo/bundledNativeModules.json' Require stack: - /Users/address/src/react-native-udacicards/noop.js I tried to remove node_modules and package-lock.json then npm install.
rollback with npm install -g expo-cli#2.4.3
I don't know if this solution will work for all the situations, but this is what fixed the issue it for me: clean the npm cache using the following command : npm cache clean --force re-install the dependencies : npm install expo install I hope it helps
1.on your package.json change expo version to "expo": "~43.0.2", (or lower) and your react-native-gesture-handler to "react-native-gesture-handler": "~1.10.2", (for expo 43.0.2) Then, on your terminal (in your project), run npm cache clean --force npm install expo doctor --fix-dependencies
I also faced this issue but Enableing USB tethering in phone, and clearing all data in expo app resolved this issue.
React native packager fails to create jsbundle
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.).
No bundle URL present (react native)
Just installed react native and trying to get Hello World up and running. Been receiving this error for the last few hours: "No bundle URL present.Make sure you're running a packager server or have included a .jsbundle file in your application bundle." I've referred to this: What means of no bundle URL present in react-native? and other similar questions, and tried everything: using my ip addresse, different combos of react-native run-iso and npm install while running and not running, tried deleting builds, cleaning project, restarting Xcode, simulator multiple times, tried react-native-upgrade, edited into.plist to allow arbitrary loads, manually setting the path to my index.ios.js, everything, and nothing works. I noticed many ran into this issue when trying to build on their device. i'm not trying to do anything fancy, just get 'hello world' up and running. Any other solutions I am not aware of?
cd into YOUR_PROJECT/ios and rm -r build, then run again react-native run-ios
I have the same issue, my problem was with info.plist I just config it as the following: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSAllowsArbitraryLoadsInWebContent</key> <true/> <key>NSAllowsLocalNetworking</key> <true/> </dict> from this solution https://stackoverflow.com/a/48471978/1627358 And then add Bash config file .bashrc with this command: echo "alias rni=\"kill \$(lsof -t -i:8081); rm -rf ios/build/; react-native run-ios\"" >> ~/.bashrc; source ~/.bashrc Then run rni from this solution https://stackoverflow.com/a/44080527/1627358 And it works fine with me.
run the following code: killall -9 node rm -rf ios/build react-native run-ios it will open launchpackager.command and the application will install on the ios simulator
The solution that worked for me. You need to run: yarn start And at the same time (in a different terminal window): yarn run:ios
Assuming that you are using nvm and multiple versions of node installed, here is the solution: Say that you run npm install -g react-native-cli in node v6.9.5. Now make node v6.9.5 as default by running nvm alias default 6.9.5 Now run react-native run-ios The problem is, you have multiple versions of node installed via nvm and to install react-native-cli you have switched or installed latest version of node, which is not marked as default node to point in nvm yet. When you run react-native run-ios this opens up another new terminal window in which default nvm is not pointed to the node version where you have installed react-native-cli. Just follow the above setup, I hope that should help. Answered the same here: https://stackoverflow.com/a/45267703/1292050
I had this issue after I run the following commands to clean the project to see the changes which were invisible because of the cache and so on: watchman watch-del-all rm -rf node_modules && npm install rm -rf /tmp/metro-bundler-cache-* or npm start -- -- reset-cache rm -rf /tmp/haste-map-react-native-packager-* The reason for the issue was in the comment in dom-structure which didn't let the application run on the device. So, check the comments too ;)
faced similar issue while running in real device app was getting crash after uploading to testflight upload and install folks this issue is killer saved by this link https://onexlab-io.medium.com/no-bundle-url-present-fixed-ca2688a80f66
The solution that worked for me. > sudo vim /etc/hosts add # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost then > sudo killall -HUP mDNSResponder the reason is I change hosts
I had the same issue happen to me not too long ago. It appears that if you renamed the project to something else and the project folder itself was renamed, you need to make sure you replace all instances of the old name with the new name and do not forget to change file names of your .xcscheme in ProjectName > ios > ProjectName.xcodeproj > xcshareddata > xcschemes. I also had to remove the build directory. Hope this works for you as well!
I've run into this issue when I tried to sync my files to iCloud Drive. I have no idea what causes this, but as soon as I turn off my iCloud Drive and reinstall brew and Node, it started to work again. I can only think that when I turned on iCloud Drive, I might have ended up having two different Node versions or any other dependency.
To debug, your best first step is to scroll through the log text that outputs in the terminal window where you fired off "npx react-native run-ios" and search for the word like "error" or "failed". This will point you toward something more specific than the general "No bundle URL present" error. For example, you might see something like "BUILD FAILED The following build commands failed: ProcessInfoPlistFile". In this example, I'd then know to go check on my Info.plist. You might see something different, but the debug methodology would still be the same. If you are trying to run iOS, another idea is to build your app with Xcode itself by opening <YOUR_PROJECT_NAME>.xcworkspace with Xcode, then review its error messages. Similarly, if you are trying to run Android, then try running with Android Studio and review its error messages.
Lots of answers are given, but one thing you should surely be taking care of while facing this issue is to make sure that your Metro server is running.
npx react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios' Try This, clear project, and run in xCode.
This relates to the answers from #Daria Kozlova and #Daniel Twork I needed to have the server running in another tab, i.e. yarn start But what I hadn't noticed is that the server had crashed with an error like: jest-haste-map: Watchman crawl failed. Retrying once with node crawler. Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project. Error: Watchman error: std::__1::system_error: open: /Users/anentropic/Documents/Dev/Work/myproject/mobile-app: Operation not permitted. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting. ... watchmanResponse: { error: 'std::__1::system_error: open: /Users/anentropic/Documents/Dev/Work/myproject/mobile-app: Operation not permitted', version: '2022.09.12.00' } The fix for that can be found here: https://github.com/facebook/watchman/issues/977#issuecomment-1189903929 i.e. run: watchman watch-del-all watchman shutdown-server and then yarn start again react-native run-ios works now
just try, npm start npm react-native run-ios
The below solved the same problem i had brew update brew reinstall watchman
Edit /etc/hosts 127.0.0.1 localhost this is work for me !!!
react-native 0.1.5 TransformError: /path_to_app/index.ios.js Unknown plugin "node-env-inline"
I've just updated both watchman, homebrew and react-native-cli The result is that all my new as well as old react-native applicationsare giving the same error. It is a TransformError in index.ios.js this is what i got in the simulator I looked into this question: [TransformError when running React Native Getting Started project (iOS)] (TransformError when running React Native Getting Started project (iOS)) But, the answer did not worked for me. i did : rm -rf node_modules npm cache clean npm i npm start and it did not work. Does any one know what is happening?
I ran into this issue as well. It appears to be a missing babel plugin. Run npm install babel-plugin-node-env-inline to fix. I also had to install babel-plugin-dunderscore-dev-inline.