【发布时间】:2021-01-05 14:15:39
【问题描述】:
我们的 bundle 入口点位于 src/index.tsx,这似乎与 ./index.js 的 Sentry 默认值不匹配。
Sentry 在 sentry-cli react-native-xcode 上失败,错误为 EOF while parsing a value at line 1 column 0。
使用调试日志级别,我看到了:
+ ENTRY_FILE=index.js
...
Error: The resource `/Users/lukecwilliams/Projects/mobile2mr/index.js` was not found.
在实际的 CLI 命令中,正在运行:--entry-file index.js
我们需要--entry-file src/index.tsx。我们如何定制这个?我在文档或源代码中找不到答案。
我找到了this solution(自定义构建脚本),但它仍然无法正常工作。
我在项目根目录中有一个脚本:
sentry-cli-xcode-build.sh:
./node_modules/react-native/packager/react-native-xcode.sh ./src/index.tsx
并且在project.pbxproj的build命令中:
shellScript = "export SENTRY_PROPERTIES=sentry.properties\nexport EXTRA_PACKAGER_ARGS=\"--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map\"\nexport NODE_BINARY=node\n../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../sentry-cli-xcode-build.sh";
但结果相当模棱两可:error: Permission denied (os error 13)
我需要以某种方式更改目录设置吗?我在 Sentry 文档或上面的 GH 答案中没有看到关于将脚本放在哪里以及如何准确引用它的具体示例。
【问题讨论】:
标签: react-native sentry