RN运行项目Error:Unable to resolve module

简介: RN运行项目Error:Unable to resolve module

今天调试demo遇到一个问题,使用react-native run-ios命令启动app,在加载bundle的时候,本地package 服务报了如下错误:

报错


···
Error: Unable to resolve module ./debugger-ui/debuggerWorker.js from ``:
None of these files exist:

微信图片_20220610114715.png

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

在React-Native官网的issues中发现了对应的问题,但是下面的反馈来看,大部分都是说rn的版本问题,当前我的demo的版本也是0.62.2

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

解决方案


打开React Native Debug Menu 页面,重新关闭打开debug就可以了。微信图片_20220610114755.png

目录
相关文章
|
6月前
报错/ ./node_modules/axios/lib/platform/index.js Module parse failed: Unexpected token (5:2)怎么解决?
报错/ ./node_modules/axios/lib/platform/index.js Module parse failed: Unexpected token (5:2)怎么解决?
|
4月前
|
前端开发
Error in created hook: “TypeError: _test.default is not a function
Error in created hook: “TypeError: _test.default is not a function
|
6月前
vue2项目安装出现Syntax Error: Error: Cannot find module ‘less‘
vue2项目安装出现Syntax Error: Error: Cannot find module ‘less‘
92 0
|
资源调度 JavaScript Windows
yarn create vite的时候,报错:SyntaxError: Unexpected token ‘.‘ at Loader.moduleStrategy (internal/modules/
yarn create vite的时候,报错:SyntaxError: Unexpected token ‘.‘ at Loader.moduleStrategy (internal/modules/
652 0
|
Unix Linux 异构计算
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See /var/log/nv
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See /var/log/nv
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See  /var/log/nv
|
JavaScript
Module not found: Error: Can‘t resolve ‘path‘
Module not found: Error: Can‘t resolve ‘path‘
975 0
vite events.js:292 throw er; // Unhandled ‘error‘ event Error: spawn esbuild.exe ENOENT
vite events.js:292 throw er; // Unhandled ‘error‘ event Error: spawn esbuild.exe ENOENT
vite events.js:292 throw er; // Unhandled ‘error‘ event Error: spawn esbuild.exe ENOENT
未解决:运行EtherCalc出错:Error: Cannot find module 'zappajs'
未解决:运行EtherCalc出错:Error: Cannot find module 'zappajs'
86 0
Module build failed: Error: Cannot find module ‘node-sass‘ Require stack报错解决
Module build failed: Error: Cannot find module ‘node-sass‘ Require stack报错解决
458 0
Module build failed: Error: Cannot find module ‘node-sass‘ Require stack报错解决
​Error -4075: File not found. An error occurred merging module <MODULENAME> for feature <FEATURENAME>.
​Error -4075: File not found. An error occurred merging module <MODULENAME> for feature <FEATURENAME>.
121 0
​Error -4075: File not found. An error occurred merging module <MODULENAME> for feature <FEATURENAME>.