Closed wcastand closed 1 year ago
Also monorepo, if it is relevant, also failing due to this error, sdk 48
found this that fix it: https://github.com/expo/sentry-expo/issues/292
const { withAppBuildGradle, withPlugins } = require("@expo/config-plugins")
const sentryFix = `project.ext.sentryCli=[collectModulesScript: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../dist/js/tools/collectModules.js")]`
function withSentryMonorepoFix(config) {
return withAppBuildGradle(config, (config) => {
config.modResults.contents = `
${sentryFix}
${config.modResults.contents}
`
return config
})
}
module.exports = (config) => withPlugins(config, [withSentryMonorepoFix])
Summary
i'm in a monorepo and the app is building as long as i don't have sentry (locally or dev app) but the preprod is failing with this logs:
this line
Error: Cannot find module '/home/expo/workingdir/build/apps/mobile-app/node_modules/@sentry/react-native/dist/js/tools/collectModules.js'
makes me think it's related to this: https://github.com/getsentry/sentry-react-native/pull/3092
I got the error after upgrading to latest sentry version after expo-doctor asked me to.
Before upgrading it was building correctly but i wasn't getting the sourcemaps on sentry.
Managed or bare workflow? If you have
ios/
orandroid/
directories in your project, the answer is bare!managed
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
48
Environment
expo-env-info 1.0.5 environment info: System: OS: macOS 13.3 Shell: 5.9 - /bin/zsh Binaries: Node: 18.15.0 - ~/Library/Caches/fnm_multishells/1676_1685350404870/bin/node Yarn: 3.6.0 - ~/Library/Caches/fnm_multishells/1676_1685350404870/bin/yarn npm: 9.5.0 - ~/Library/Caches/fnm_multishells/1676_1685350404870/bin/npm Watchman: 2023.03.13.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/lib/ruby/gems/3.1.0/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: Android NDK: 22.1.7171670 IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9971841 Xcode: 14.3/14E222b - /usr/bin/xcodebuild npmGlobalPackages: eas-cli: 3.13.3 Expo Workflow: managed
Reproducible demo or steps to reproduce from a blank project
none