React Native Bundlereles任务失败了错误,“资源`index.js'在MonorePo上未在React-native 0.66.0升级到0.68.2之后。
我有一个移动应用程序和一个用于同一应用程序的Web应用程序,并且我使用纱线工作区MonorePo来管理这两个和各种软件包中的共享代码。我已经成功运行了几个月的设置。我需要对同一配置文件进行更改才能使其正常工作,但是到目前为止它一直运行良好。
今天,我从反应新的0.66.0更新到0.68.2。我进行了所有必需的更改,并且能够在iOS和Android上以调试模式运行该应用程序。我还能够成功构建iOS应用程序。但是在Android上,我遇到了以下错误:
warning: the transform cache was reset.
error The resource `/Users/username/Projects/myapp-monorepo/index.js` was not found.
Error: The resource `/Users/username/Projects/myapp-monorepo/index.js` was not found.
at /Users/username/Projects/myapp-monorepo/node_modules/metro/src/IncrementalBundler.js:297:24
at gotStat (node:fs:2654:21)
at FSReqCallback.oncomplete (node:fs:198:21)
info Run CLI with --verbose flag for more details.
> Task :app:bundleReleaseJsAndAssets FAILED
> Task :app:[email protected]+7340962_7340962 FAILED
INFO 2022-05-30 19:23:40.400504 +05:30 Loaded config from /Users/username/.sentryclirc
DEBUG 2022-05-30 19:23:40.401302 +05:30 sentry-cli version: 1.74.4, platform: "darwin", architecture: "x86_64"
INFO 2022-05-30 19:23:40.401310 +05:30 sentry-cli was invoked with the following command line: "/Users/username/Projects/myapp-monorepo/node_modules/@sentry/cli/sentry-cli" "--log-level" "debug" "react-native" "gradle" "--bundle" "/Users/username/Projects/myapp-monorepo/packages/GalarmApp/android/app/build/generated/assets/react/release/index.android.bundle" "--sourcemap" "/Users/username/Projects/myapp-monorepo/packages/GalarmApp/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map" "--release" "[email protected]+7340962" "--dist" "7340962"
error: An organization slug is required (provide with --org)
DEBUG 2022-05-30 19:23:40.401360 +05:30 skipping update nagger because session is not attended
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:[email protected]+7340962_7340962'.
> Process 'command '/Users/username/Projects/myapp-monorepo/node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
如您所见,它正在尝试访问/users/username/projects/myapp-monorepo/index.js
,并且当然找不到它该文件不存在。该文件位于App Monorepo的位置/users/username/projects/myapp-monorepo/packages/myapp/index.js
。
我不确定这是哪里来的,因此我可以修复相应的配置文件。它似乎与地铁,哨兵和发布构建任务有关。
由于这个问题,我完全被困住了。如果您有任何指示,请分享。
I have a mobile app and a web app for the same application and I use yarn workspaces monorepo to manage the two and the shared code in various packages. I have running this setup for a few months now successfully. I needed to make changes to same config files to get it work but it has been working very well till now.
Today, I updated from react-native 0.66.0 to 0.68.2. I made all the required changes and I am able to run the app in debug mode on iOS and Android. I am also able to build the iOS app successfully. But on Android, I am running into the following error:
warning: the transform cache was reset.
error The resource `/Users/username/Projects/myapp-monorepo/index.js` was not found.
Error: The resource `/Users/username/Projects/myapp-monorepo/index.js` was not found.
at /Users/username/Projects/myapp-monorepo/node_modules/metro/src/IncrementalBundler.js:297:24
at gotStat (node:fs:2654:21)
at FSReqCallback.oncomplete (node:fs:198:21)
info Run CLI with --verbose flag for more details.
> Task :app:bundleReleaseJsAndAssets FAILED
> Task :app:[email protected]+7340962_7340962 FAILED
INFO 2022-05-30 19:23:40.400504 +05:30 Loaded config from /Users/username/.sentryclirc
DEBUG 2022-05-30 19:23:40.401302 +05:30 sentry-cli version: 1.74.4, platform: "darwin", architecture: "x86_64"
INFO 2022-05-30 19:23:40.401310 +05:30 sentry-cli was invoked with the following command line: "/Users/username/Projects/myapp-monorepo/node_modules/@sentry/cli/sentry-cli" "--log-level" "debug" "react-native" "gradle" "--bundle" "/Users/username/Projects/myapp-monorepo/packages/GalarmApp/android/app/build/generated/assets/react/release/index.android.bundle" "--sourcemap" "/Users/username/Projects/myapp-monorepo/packages/GalarmApp/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map" "--release" "[email protected]+7340962" "--dist" "7340962"
error: An organization slug is required (provide with --org)
DEBUG 2022-05-30 19:23:40.401360 +05:30 skipping update nagger because session is not attended
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:[email protected]+7340962_7340962'.
> Process 'command '/Users/username/Projects/myapp-monorepo/node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
As you can see, it is trying to access /Users/username/Projects/myapp-monorepo/index.js
and not finding it which of course the file is not there. The file is located in the app monorepo at location /Users/username/Projects/myapp-monorepo/packages/myapp/index.js
.
I am not sure where is this coming from so I can fix the corresponding config file. It seems to be related to metro, Sentry and the release build task.
I am totally stuck due to this problem. If you have any pointers, please share.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果有人仍在寻找此答案,
错误。
那么当我们将
index.js
文件名称为index.jsx
或index.tsx
解决只需将名称更改回
index.js
if anyone is still looking for this answer
the error is
this happens when we change the
index.js
file name toindex.jsx
orindex.tsx
to resolve just change the name back to
index.js