Skip to content

Commit 9282172

Browse files
fix(expo): Upload script should not log out env file not found errors (#4332)
1 parent f6c37bb commit 9282172

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
### Fixes
3939

4040
- Return `lastEventId` export from `@sentry/core` ([#4315](https://github.com/getsentry/sentry-react-native/pull/4315))
41+
- Don't log file not found errors when loading envs in `sentry-expo-upload-sourcemaps` ([#4332](https://github.com/getsentry/sentry-react-native/pull/4332))
4142
- Navigation Span should have no parent by default ([#4326](https://github.com/getsentry/sentry-react-native/pull/4326))
4243

4344
### Dependencies

packages/core/scripts/expo-upload-sourcemaps.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,12 @@ function loadDotenv(dotenvPath) {
111111

112112
Object.assign(process.env, dotenvResult);
113113
} catch (error) {
114-
console.warn('⚠️ Failed to load environment variables using dotenv.');
115-
console.warn(error);
114+
if (error.code === 'ENOENT') {
115+
// noop if file does not exist
116+
} else {
117+
console.warn('⚠️ Failed to load environment variables using dotenv.');
118+
console.warn(error);
119+
}
116120
}
117121
}
118122

0 commit comments

Comments
 (0)