RN运行项目报错Unabletoresolve module

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

报错

···

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

···



在React-Native官网的[issues](https://github.com/facebook/react-native/issues/28844)中发现了对应的问题,但是下面的反馈来看,大部分都是说rn的版本问题,当前我的demo的版本也是0.62.2

```

"react": "16.11.0",

"react-native": "0.62.2",

```

解决方案

打开React Native Debug Menu 页面,重新关闭打开debug就可以了。



觉得文章不错的,给我点个赞哇,关注一下呗!

技术交流可关注公众号【君伟说】,加我好友一起探讨

版权声明:

作者: freeclashnode

链接: https://www.freeclashnode.com/news/article-1817.htm

来源: FreeClashNode

文章版权归作者所有,未经允许请勿转载。

免费节点实时更新

热门文章

最新文章

归档