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
To upload source maps, the Sentry Nuxt Module will automatically enable source map generation in your project if it is not already enabled.
165
-
However, you need to explicitly enable source map generation on the client-side.
166
-
To do this, add the following code to your Nuxt configuration:
164
+
The Sentry Nuxt Module automatically enables source map generation for your project,
165
+
but you'll need to enable it explicitly for the client-side. Add this code to your Nuxt configuration:
167
166
168
167
```javascript {filename:nuxt.config.ts} {2}
169
168
exportdefaultdefineNuxtConfig({
170
169
sourcemap: { client:'hidden' }
171
170
});
172
171
```
173
172
174
-
The option `'hidden'` works like `true`, but suppresses the source map reference comments that would be added to the end of each generated file in the build output.
173
+
The 'hidden' option functions the same as `true`, by enabling source map generation, but it also suppresses the source map reference comments that would
174
+
normally appear at the end of each generated file in the build output. This keeps the source maps available without exposing their references in the files.
175
175
176
-
When opening browser developer tools, browsers attempt to fetch source maps through reference comments at the end of bundled files.
177
-
After those source maps are uploaded to Sentry during the build process and the SDK removes these client-side source maps, any reference to source maps would trigger 404 errors in the developer tools.
178
-
The `'hidden'` option prevents these reference comments from being generated, stopping browsers from attempting to fetch non-existent map files.
179
-
This approach eliminates unnecessary network errors in browser developer tools.
176
+
When you open browser developer tools, browsers try to fetch source maps using reference comments in bundled files. If source maps are uploaded to Sentry and
177
+
removed from the client-side, these references cause 404 errors in developer tools. The `'hidden'` option stops these comments from being generated, preventing browsers
178
+
from trying to fetch missing files and avoiding unnecessary errors.
180
179
181
-
Explicitly enabling client source maps is necessary because Nuxt sets default values for source maps ([Nuxt docs](https://nuxt.com/docs/api/nuxt-config#sourcemap)), and the Sentry Nuxt Module keeps these settings when they are explicitly defined.
180
+
You need to explicitly enable client-side source maps because Nuxt applies default [source map settings](https://nuxt.com/docs/api/nuxt-config#sourcemap), and
181
+
the Sentry Nuxt Module respects these when they are explicitly defined.
0 commit comments