Skip to content

Commit 1d5ce15

Browse files
authored
Update chrome-extensions.mdx
1 parent 584aed8 commit 1d5ce15

File tree

1 file changed

+0
-86
lines changed

1 file changed

+0
-86
lines changed

docs/platforms/dart/guides/flutter/configuration/chrome-extensions.mdx

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -62,89 +62,3 @@ sentry_dart_plugin
6262
```
6363

6464
Make sure you have the [Sentry Dart Plugin](/platforms/dart/guides/flutter/configuration/options/#sentry-dart-plugin) properly configured in your project.
65-
66-
## Complete Example
67-
68-
Here's a minimal example of the required files:
69-
70-
<details>
71-
<summary><code>web/index.html</code></summary>
72-
73-
```html {filename:web/index.html}
74-
<!DOCTYPE html>
75-
<html>
76-
<head>
77-
<base href="$FLUTTER_BASE_HREF">
78-
<meta charset="UTF-8">
79-
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
80-
<meta name="description" content="My Chrome Extension">
81-
<meta name="apple-mobile-web-app-capable" content="yes">
82-
<meta name="apple-mobile-web-app-status-bar-style" content="black">
83-
<meta name="apple-mobile-web-app-title" content="My Extension">
84-
<link rel="apple-touch-icon" href="icons/Icon-192.png">
85-
<link rel="icon" type="image/png" href="favicon.png"/>
86-
<title>My Chrome Extension</title>
87-
<link rel="manifest" href="manifest.json">
88-
89-
<!-- Sentry JavaScript SDK -->
90-
<script src="bundle.tracing.min.js" type="application/javascript"></script>
91-
92-
<script>
93-
// Required for Chrome Extensions
94-
var serviceWorkerVersion = null;
95-
</script>
96-
<script src="flutter_service_worker.js?v=$FLUTTER_SERVICE_WORKER_VERSION" defer></script>
97-
</head>
98-
<body id="app-container">
99-
<script src="main.dart.js" type="application/javascript"></script>
100-
</body>
101-
</html>
102-
```
103-
104-
</details>
105-
106-
<details>
107-
<summary><code>pubspec.yaml</code> dependencies</summary>
108-
109-
```yaml {filename:pubspec.yaml}
110-
dependencies:
111-
flutter:
112-
sdk: flutter
113-
sentry_flutter: ^{{@inject packages.version('sentry.dart.flutter') }}
114-
115-
dev_dependencies:
116-
sentry_dart_plugin: ^{{@inject packages.version('sentry.dart.plugin') }}
117-
```
118-
119-
</details>
120-
121-
## Build and Deploy
122-
123-
1. Build your Flutter web app:
124-
```bash
125-
flutter build web --no-web-resources-cdn --pwa-strategy=none --source-maps
126-
```
127-
128-
2. Upload source maps:
129-
```bash
130-
dart run sentry_dart_plugin
131-
```
132-
133-
3. Package your Chrome Extension using the built files in the `build/web/` directory.
134-
135-
## Troubleshooting
136-
137-
**Script loading errors**: If you encounter script loading errors, ensure that:
138-
- The Sentry JavaScript bundle is properly downloaded and placed in the `web/` directory
139-
- The script tag in `index.html` has the correct path
140-
- Your Chrome Extension's `manifest.json` allows the necessary permissions
141-
142-
**CSP violations**: If you're still seeing CSP violations:
143-
- Verify that you're not loading any external resources
144-
- Check that the `--no-web-resources-cdn` flag is being used during build
145-
- Ensure your extension's `manifest.json` has appropriate CSP settings
146-
147-
**Source maps not uploading**: If source maps fail to upload:
148-
- Verify your Sentry project configuration in `pubspec.yaml`
149-
- Check that you have proper authentication configured for the Sentry CLI
150-
- Ensure the `--source-maps` flag is included in your build command

0 commit comments

Comments
 (0)