You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,49 @@ A custom `dist` value will also be used as the build number.
127
127
128
128
If provided, the plugin will take your `release` and `dist` values without further mutating them. Make sure you configure everything as outlined in the [release docs](https://docs.sentry.io/product/cli/releases/) of `sentry-cli`.
129
129
130
+
## Web
131
+
132
+
If you're publishing your app on the web and it's not deployed at the root of your URL, you need to configure a `prefix` and update your stack frames.
133
+
134
+
Add the prefix to your `pubspec.yaml` in addition to your other configurations. Make sure that you have `upload_source_maps` enabled:
135
+
136
+
```properties
137
+
sentry:
138
+
upload_source_maps=true
139
+
prefix: ~/your_prefix/
140
+
```
141
+
142
+
The absolute path of your stack frames also needs to include the same prefix so that the source maps can be found for deobfuscation. Below is an example of how to update the stack frame's absolute path to include the prefix using the `beforeSend` hook:
143
+
144
+
```dart
145
+
options.beforeSend = (event, hint) async {
146
+
final exceptions = event.exceptions?.map((exception) {
147
+
final stackTrace = exception.stackTrace;
148
+
if (stackTrace != null) {
149
+
final frames = stackTrace.frames.map((frame) {
150
+
const baseUrl = 'https://your-domain.com/';
151
+
final modifiedAbsPath = frame.absPath?.replaceFirst(
0 commit comments