52

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:

  1. Clear watchman watches: watchman watch-del-all .
  2. Delete the node_modules folder: rm -rf node_modules && npm install .
  3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache .
  4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-* .
  5. 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)
3
  • Can you share your package.json as well?
    – Alwaysblue
    Commented Jan 10, 2020 at 8:09
  • 1
    I had another error about the navigation module being moved. When I fixed that your error went away.
    – dsbmac
    Commented Jan 11, 2020 at 23:25
  • I have the same error. Is there a way to fix it without downgrading npm?
    – zengod
    Commented Jan 14, 2020 at 23:39

15 Answers 15

43

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.

5
  • Thank you so much @chaim Commented May 12, 2020 at 17:37
  • The solution works partially, the debugger starts working, but the error in console didn't disappear. Anyway, that solution helped to continue working. Thank you! Commented May 23, 2020 at 9:44
  • Same for me Chaki. No error but the issue with missing module is gone. At least...
    – kwoxer
    Commented Jul 20, 2020 at 4:54
  • 3
    For those confused that alt + control + click on reload button, this only works if you have the inspector open, with cmd + alt + i (though for me, doing a hard cache reload didn't fix the issue)
    – fredrivett
    Commented Nov 8, 2020 at 16:39
  • Tried the same but not work
    – Madhav
    Commented Jan 6, 2023 at 6:43
9

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

1
  • This + a hard cache reset worked for me. I suspect it has to do with mixing package managers, as the bug happened right after I used Yarn for one of the packages after only using NPM.
    – Chen W
    Commented Nov 4, 2022 at 21:19
6

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

1
  • 3
    nice share npx react-native-clean-project. Thanks.
    – armand
    Commented Oct 16, 2020 at 8:50
3

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

1
  • 1
    thanks for the answer, so how to fix it?
    – nima
    Commented Jun 9, 2022 at 8:04
1

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.

1

found here: https://github.com/react-native-community/cli/issues/1081#issuecomment-1025055453

  • manually uninstall the app
  • npm run start --reset-cache

done !

0

I resovled this error by removing node modules + yarn.lock in project

0

In my case ,I have updated react-native verison and the debugger broke.

Run npm i react-devtools-core in order to update debugger.

0

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!!!

0

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

0

I reinstalled the Expo application, and the problem disappeared. Maybe it will help someone, too.

0

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.

0

For what it's worth: When using a Development Build, ensure the app on the device has the most recent build, with the native modules included.

0

I forgot to import react in one of functional component and started getting this issue.

import React from 'react'

After adding it issue resolved.

-1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.