Closed jamesloper closed 1 year ago
Think this is related. I'm on sdk 46 (using "@sentry/react-native": "4.2.2"
and "sentry-expo": "~5.0.0"
) and experiencing that sometimes it does not upload the source map, which is a problem since it creates a new archive with the same release name.
It seems like its the android postPublish hook that is causing it. So it also might be related to #292
For OTA updates you need to upload the bundle and the source maps manually.
https://docs.expo.dev/guides/using-sentry/#uploading-sourcemaps-for-updates
Maybe this repo (managed workflow) can also help with finding the bug. https://github.com/krystofwoldrich/sentry-expo-sample-app
are we expected to do stuff like this to hack it to work?
import inquirer from 'inquirer';
import { createRequire } from 'module';
import { execa } from 'execa';
import fs from 'fs';
const require = createRequire(import.meta.url); // song and dance
const {BASE_DOMAIN, RELEASE_CHANNEL} = require('./constants/config.json');
inquirer.prompt([{
name: 'confirm',
message: 'Are you sure you want to deploy to this config? \n' +
`BASE_DOMAIN: ${BASE_DOMAIN}\n` +
`RELEASE_CHANNEL: ${RELEASE_CHANNEL}`,
type: 'confirm',
}]).then(async answers => {
if (!answers.confirm) return console.log('Cancelled! Bye!');
await execa('watchman', ['watch-del ./']);
await execa('watchman', ['watch-project ./']);
const eas = await execa('eas', ['update', '--auto', '--branch', RELEASE_CHANNEL]);
console.log(eas.stdout);
const iosUpdateId = eas.stdout.split('\n').find(s => s.startsWith('iOS update ID')).split(' ').pop();
const bundles = fs.readdirSync('dist/bundles');
const iosBundle = bundles.find(s => s.startsWith('ios-') && s.endsWith('.js'));
const iosMap = bundles.find(s => s.startsWith('ios-') && s.endsWith('.map'));
fs.renameSync(`dist/bundles/${iosBundle}`, 'dist/bundles/main.jsbundle');
const sentry = await execa('node_modules/@sentry/cli/bin/sentry-cli', [
'releases',
'--org', 'hotspot-app',
'files', `com.hux.hotspot@staging`,
'upload-sourcemaps',
'--dist', iosUpdateId,
'--rewrite',
`dist/bundles/main.jsbundle`, `dist/bundles/${iosMap}`,
], {
env: {
'SENTRY_PROJECT': 'hotspot',
},
});
console.log(sentry);
});
Based on the docs I believe you are right @jamesloper if you want to automatize the process.
Disclaimer, I maintain the @sentry/react-native
, so when it comes to sentry-expo
my knowledge is limited.
This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.
Summary
I followed the guide to install
sentry-expo
which resulted in sentry-expo 5.0.0 being installed. I already fixed this myself by updating manually to"sentry-expo": "6.0.0"
If I run
eas update
an OTA is published successfully and the client receives the update however the source maps are missing from sentry. To debug, I add aconsole.log('HERE123')
to upload-sourcemaps.js I noticed that HERE123 does not show when runningeas update
.I have postPublish and plugins declared in app.json
the result? postPublish script is not being called!
Managed or bare workflow? If you have
ios/
orandroid/
directories in your project, the answer is bare!bare
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
47
Environment
Reproducible demo or steps to reproduce from a blank project
https://docs.expo.dev/guides/using-sentry/