Closed alejandrocarebit closed 1 month ago
Hi @alejandrocarebit, thank you for creating the issue, for full context this issue was created based on https://stackoverflow.com/questions/78842407/how-to-access-expo-dashboard-secrets-in-eas-update-for-sentry-integration-in-rea/78844262#78844262
Could you share a bit more details on what update strategy are you using?
Are you using https://docs.expo.dev/versions/latest/sdk/updates/#updatesreloadasync
Hi Krystof,
Thanks for your answer. I'm using the standard strategy for React Native described in the Expo and Sentry docs:
I installed the expo-updates
dependency (version 0.25.21).
I added these two new entries in my app.config.js
:
updates: {
url: 'https://u.expo.dev/my-id',
},
runtimeVersion: {
policy: 'appVersion',
},
3- I modified my metro.config.js
file:
const { getSentryExpoConfig } = require('@sentry/react-native/metro');
const config = getSentryExpoConfig(__dirname);
module.exports = config;
4- I added two channels (preview/production) in my eas.json
file:
{
"preview": {
"channel": "preview",
"distribution": "internal",
"env": {
"APP_VARIANT": "preview",
"EXPO_PUBLIC_API_URL": "https://my-staging-url.com"
}
},
"production": {
"channel": "production",
"autoIncrement": true,
"env": {
"APP_VARIANT": "production",
"EXPO_PUBLIC_API_URL": "https://my-prod-url.com"
}
}
}
Following these steps Expo Update works, the only issue I have is that errors are not being tracked in Sentry anymore after that.
@alejandrocarebit Thank you for the confirmation. So no manual apis are used (https://docs.expo.dev/versions/latest/sdk/updates/#updatesreloadasync).
We will investigate this.
Thanks a lot Krystof, I highly appreciate your help.
Hi @alejandrocarebit, sadly I'm not able to reproduce the behavior.
I wanted to check are you able to reproduce the error also with Development Builds and Extensions Tab -> https://docs.expo.dev/eas-update/publish/#testing-a-published-update
Would you be able to share a reproducible example with us?
Hi @krystofwoldrich,
Unfortunately I haven't been able to reproduce it with Development builds, it seems to work fine. This is weird, I'll try to reproduce it again in a preview / production build and share an example with you.
Thanks for your help.
@alejandrocarebit Thank you.
Closing this due to inactivity. If this is still an issue feel free to comment here or open a new issue if the context changed.
OS:
Platform:
SDK:
@sentry/react-native
(>= 1.0.0)react-native-sentry
(<= 0.43.2)SDK version: 5.27.0
react-native
version: 0.0.0Are you using Expo?
Are you using sentry.io or on-premise?
If you are using sentry.io, please post a link to your issue so we can take a look:
[Link to issue]
Configuration:
(
@sentry/react-native
)I have the following issue:
I have a React Native application created with Expo and use Expo EAS Build for my preview and production builds.
I have three environment variables:
EXPO_PUBLIC_API_URL
: This changes based on whether the build is for preview or production. Two secret keys, one of which isSENTRY_AUTH_TOKEN
. Locally, I use a .env file for environment variables when working in development, but I don't includeSENTRY_AUTH_TOKEN
there because Sentry isn't needed in development.For EAS Build, I have added
EXPO_PUBLIC_API_URL
to eas.json as follows:The other two environment variables have been added as secrets in the Expo dashboard being
SENTRY_AUTH_TOKEN
one of them. So far, everything works perfectly.I have tested that errors are properly tracked in Sentry by throwing an error when pressing a button:
I'm now setting up Expo EAS Update based on the documentation:
When I run the command
eas update --branch preview
, I noticed that EAS Update takes the environment variables from my local .env file. However, it doesn't have access to the secrets from the Expo dashboard.As a result, when I make an update, the app doesn't report errors to Sentry. I suspect it is because
SENTRY_AUTH_TOKEN
is undefined since EAS Update is not able to retrieve the secrets from the Expo dashboard. I've also uploaded the source maps successfully by runningnpx sentry-expo-upload-sourcemaps dist
but get the same result.The way I test it is the same as before, throwing an error when pressing a button but this time the error is not tracked by Sentry:
Steps to reproduce:
Actual result:
Errors are not being tracked anymore after updating the app via EAS Update.
Expected result:
I expect errors being tracked after the update, otherwise EAS Update is useless for me.