Nuxt source map setup quite confusing #18205
GitRowin
started this conversation in
Features / New SDKs (Integrations) / Ideas
Replies: 1 comment
-
|
@s1gr1d I think you might be interested in this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My goal was to setup client and server source maps for Sentry but have them not appear in the final build.
If I understand sourceMaps.ts correctly, the original idea was that if I don't configure Nuxt's
sourcemapsetting, Sentry should generate hidden source maps for both the client and the server, and delete them after uploading them. Except this doesn't quite work because Nuxt defaultssourcemap.clientto false, so the Sentry for Nuxt docs tell you to setsourcemap.clienttohidden. This works, but then the source maps are not deleted by Sentry.According to the Sentry for Vue docs, you can set the
sourcemaps.filesToDeleteAfterUploadoption to make Sentry delete them. I tried setting it to["**/*.map"]which did not work. It took me quite some time to figure out that the pattern should start with a.because Nuxt's output folder.outputstarts with a dot (see "Dots" under Glob Primer). I now use[".output/**/*.map"]with success.Another option I discovered is simply setting both
clientandserverto undefined. This makes the "built-in" source map generation and deletion logic I described in the beginning work.I figured I would leave this here, maybe it helps someone else or maybe it can be used to improve the documentation.
Beta Was this translation helpful? Give feedback.
All reactions