RN running project Error: Unable to resolve module

created at 07-07-2021 views: 4

description

Today I encountered a problem with the debugging demo. I used the react-native run-ios command to start the app. When the bundle was loaded, the local package service reported the following error:

error

Error: Unable to resolve module ./debugger-ui/debuggerWorker.js from ``:

None of these files exist:

debugger-ui/debuggerWorker.js(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
debugger-ui/debuggerWorker.js/index(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
at ModuleResolver.resolveDependency (/Users/fantuan/RnDemo/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:163:15)
at ResolutionRequest.resolveDependency (/Users/fantuan/RnDemo/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
at DependencyGraph.resolveDependency (/Users/fantuan/RnDemo/node_modules/metro/src/node-haste/DependencyGraph.js:287:16)
at /Users/fantuan/RnDemo/node_modules/metro/src/lib/transformHelpers.js:267:42
at Server.<anonymous> (/Users/fantuan/RnDemo/node_modules/metro/src/Server.js:841:41)
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/fantuan/RnDemo/node_modules/metro/src/Server.js:99:24)
at _next (/Users/fantuan/RnDemo/node_modules/metro/src/Server.js:119:9)
[Fri Sep 25 2020 12:45:39.478] BUNDLE ./index.js

Corresponding problems were found in the issues on the React-Native official website, but from the feedback below, most of them are about the version of rn. The current version of my demo is also 0.62.2.

"react": "16.11.0",
 "react-native": "0.62.2",

solution

Open the React Native Debug Menu page, close and open debug again.

solution

Please log in to leave a comment.