metro: Unable to resolve module ./debugger-ui/debuggerWorker.aca173c4.js

Report a bug App crash when i turn debug on mode

versions

    "react-native": "0.66.0",
    "metro-react-native-babel-preset": "0.66.2",

What is the current behavior? The app work fine but it crash when i turn it to debug mode

How can i reproduce the error? After a yarn dev and yarn android when i turn it to debug mode it crash and i can see only the error below

You can test it by your self from here install start-ui native

npx create-start-ui --native myApp

That will scaffold a new folder with the latest version of šŸš€ Start UI <small>[native]</small> šŸŽ‰

Then just go to the created folder cd myApp and follow the Installation Guide.

What is the error I’m getting? After a yarn dev and yarn android when i turn it to debug mode it crash and i can see only this error

Error: Unable to resolve module ./debugger-ui/debuggerWorker.aca173c4.js from /home/omar/Documents/Projects/JawDay-mobile/.: 

None of these files exist:
  * debugger-ui/debuggerWorker.aca173c4.js(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
  * debugger-ui/debuggerWorker.aca173c4.js/index(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
    at ModuleResolver.resolveDependency (/home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:107:15)
    at DependencyGraph.resolveDependency (/home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/node-haste/DependencyGraph.js:288:43)
    at /home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/lib/transformHelpers.js:129:24
    at Server._resolveRelativePath (/home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/Server.js:1072:12)
    at async Server.requestProcessor [as _processSourceMapRequest] (/home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/Server.js:428:37)
    at async Server._processRequest (/home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/Server.js:389:7)
Error: Unable to resolve module ./debugger-ui/debuggerWorker.aca173c4.js from /home/omar/Documents/Projects/JawDay-mobile/.: 

None of these files exist:
  * debugger-ui/debuggerWorker.aca173c4.js(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
  * debugger-ui/debuggerWorker.aca173c4.js/index(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
    at ModuleResolver.resolveDependency (/home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:107:15)
    at DependencyGraph.resolveDependency (/home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/node-haste/DependencyGraph.js:288:43)
    at /home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/lib/transformHelpers.js:129:24
    at Server._resolveRelativePath (/home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/Server.js:1072:12)
    at async Server.requestProcessor [as _processSourceMapRequest] (/home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/Server.js:428:37)
    at async Server._processRequest (/home/omar/Documents/Projects/JawDay-mobile/node_modules/metro/src/Server.js:389:7)

this error guide me to metro modules so this is i put the issue here

what is metro config in the project in file metro.config.js

/**
 * Metro configuration for React Native
 * https://github.com/facebook/react-native
 *
 */

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false, // false because of hermes issue https://github.com/storybookjs/react-native/issues/152
      },
    }),
  },
};

Can someone find solution for this probleme i tested all solutions here but it doesnt work

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 37
  • Comments: 57 (3 by maintainers)

Most upvoted comments

Deleting the Cache from Google Chrome fixed this issue for me.

Settings -> More Tools -> Clear browsing data

Make sure to select ā€œAll timeā€

Screen Shot 2021-11-25 at 10 49 25 AM

I am building an app with react-native (without expo) and it works both on simulator and on actual iPhone. But when I go in debug mode (Shake and Debug with Chrome) on simulator, the screens turns black. In my opinion the app is still running, because I get the same error messages as before but I can’t do anything. All of the dependencies are up to date and reset of entire project doesn’t help either. Does anyone experience the same issues and is there any fix? Bildschirmfoto 2021-12-29 um 15 19 37

Same problem here, I’ve tried everything and it didn’t work I formatted my machine and nothing, the worst thing is that I’m in the final stage of the project and late.

Since version 2.x of react-native-reanimated does not yet support remote debugging (https://docs.swmansion.com/react-native-reanimated/docs/#known-problems-and-limitations), I downgraded to Version 1.13.1. and the debugger finally worked again. Unfortunately I do not know yet, if the lower version of react-native-reanimated has any impact on other libraries which rely on it (react-navigation for example). I hope this helps a little. 😃

Fixed for me with upgrade react-native-reanimated to 2.7.0

I’ve spend two days trying to solve this problem, but couldn’t find any solution, so what I’m doing now is debug the app with Flipper, I don’t like as much debug with Chrome but is the only solution I have found

The issue still persist in ā€œreact-nativeā€: ā€œ0.67.2ā€ any help here?

same issue for me.

When I stop Chrome debugging, the app works fine, but when I debug using Chrome, I get errors.

Screenshot 2023-02-25 at 4 30 30 PM

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

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

done !

I had similar issue, and I found out that react-native-reanimated package caused the issue for me. Please note that Reanimated 2 doesn’t support remote debugging, only Flipper can be used for debugging. https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/

@omar-bear Can you check which version of @react-native-community/cli-debugger-ui you have installed? It seems like https://github.com/react-native-community/cli/pull/1307 should have fixed this.

Also, have you tried clearing your Chrome cache?

Error in debuuger console

Error: Requiring module "node_modules\react-native-reanimated\src\Animated.js", which threw an exception: Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome.

 Consider providing alternative methods to expose this method in debug mode, e.g. by exposing constants ahead-of-time.

And the reanimated package version "react-native-reanimated": "~2.8.0", with autoupdates doesn’t support the remote debugging, Flipper is the only option for now

As the library uses JSI for synchronous native methods access, remote debugging is no longer possible. You can use Flipper for debugging your JS code, however connecting debugger to JS context which runs on the UI thread is not currently supported. Read

@PhilippLeh21 Thanks šŸŽ©

same issue, Error: Unable to resolve module ./debugger-ui/debuggerWorker.aca173c4. Worked for me to uninstall Expo from Android, run expo start again, open on android, it install expo again on my device and then in worked.

This error start for me after I start debugging remotely in emulator ios, using command shift+m, toggle developer menu >enabled Debug Remote JS. Although disabling debug remote js helps to evade the error for now. But still looking for complete solution.

@lid3rs I tried your step but still the same problem

Expo build app doesn’t crash but still log the same error for me when debugger is on:

Error: Unable to resolve module ./debugger-ui/debuggerWorker.aca173c4

Installing @react-native-community/cli-debugger-ui + clearing application data in inspect solved this to me.

I am experiencing this same error although am not using metro-react-native-babel-preset, just metro. What I’ve found is booting up a brand new expo project (SDK 44, comes with metro 0.64) and upgrading to metro 0.65.2 causes the debugger issue, and downgrading back to 0.64 resolves it

For me, it was working in real device but getting this error in simulator. Im using React Native debugger. I resolved it by following steps:

Run the app in real device and turn on the debug mode. (logs started showing in the debugger) Now run the app in the simulator without debug mode. Now turn on the debug mode in simulator. Now the log will start showing in the debugger.

It started happening for me when I upgraded my app to RN 0.71.

After trying so many things mentioned above (with no fix), finally I did find the solution my own, go to your phone’s app settings choose (expo go) app, i- Remove Cache ii- Remove App Data. restart the expo app on the phone.

run the server again (npm start or expo start)

it should work perfectly fine.

turn off the debugger , exit the debugger ,

desligue o debugger , saia do debugger ,

I am on macOS, I installed React Native Debugger brew install react-native-debugger as it was adviced in corresponding section in the expo documentation https://docs.expo.dev/workflow/debugging/ , and the error was gone, so I was able to debug the app in vscode