Expo集成Sentry:执行eas update后index.android.bundle未上传
Sentry-Expo EAS Update 源码映射失效:bundle文件未上传导致dist不匹配
我使用sentry-expo可正常向Sentry服务器上报错误,已遵循Expo官方文档配置源码映射上传流程。
问题现象
- 首次构建项目时,
index.android.bundle及其对应的.map文件可正常上传至Sentry - 执行
eas update推送更新时,按照文档提供的sentry-cli脚本操作,仅android-'hash'.map文件被上传,index.android.bundle未上传
这导致bundle与map文件的dist字段不匹配,Sentry无法解析源码映射信息,报错如下:
Source code was not found (see Troubleshooting for JavaScript) Url app:///index.android.bundle
尝试过的操作
- 将脚本中的
index.android.bundle改为index.android.bundle.js后,文件可成功上传,但问题仍存在。推测原因是归档路径变为~/index.android.bundle.js,而Sentry期望的路径是~/index.android.bundle
环境版本
{ "@sentry/react-native": "4.9.0", "expo": "~47.0.8", "sentry-expo": "~6.0.0" }
使用的脚本(Windows系统,通过cross-env兼容)
cross-env ./node_modules/@sentry/cli/bin/sentry-cli releases --org 'organization name' --project 'project name' files 'release name' upload-sourcemaps --dist 'Android Update ID' --rewrite dist/bundles/index.android.bundle dist/bundles/android-'hash'.map
已在干净仓库中测试并提交相关Issue,恳请提供解决帮助。
内容的提问来源于stack exchange,提问作者Hessuew
相关产品推荐
相关产品推荐

