Commit cbf87ac
fix(core): Always re-initialize native SDK from JS in dev builds (#5872)
When `sentry.options.json` exists (generated by the Expo config plugin
with `useNativeInit: true`), the SDK was setting
`autoInitializeNativeSdk = false`, skipping the JS-side `initNativeSdk`
call entirely. This prevented the native log bridge and runtime values
(devServerUrl, defaultSidecarUrl) from being set up, causing zero
envelopes to be sent to sentry.io in development builds.
The fix adds a `!__DEV__` guard so that in dev builds, JS always
re-initializes native (the native SDK handles double-init gracefully
with "Previous configuration will be overwritten"). In release builds,
the existing behavior is preserved for app start crash capture.
Closes #5734
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent beeb5b9 commit cbf87ac
2 files changed
Lines changed: 33 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
| 143 | + | |
| 144 | + | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
142 | 166 | | |
143 | 167 | | |
144 | 168 | | |
| |||
155 | 179 | | |
156 | 180 | | |
157 | 181 | | |
158 | | - | |
| 182 | + | |
159 | 183 | | |
160 | 184 | | |
161 | 185 | | |
| |||
0 commit comments