-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NuxtJS: Source map deletion after upload #13632
Comments
Hey @SVV-team, assuming you are using the |
Deletion working, but....
After deploy to production sentry handle many errors |
hi @SVV-team, could you please link to one of those issues? |
https://svv-team.sentry.io/share/issue/db391adafe1148bda0acdf3c9f36fe61/ |
@SVV-team would mind sharing your |
export default defineNuxtConfig({
modules: [
'@pinia/nuxt',
'@nuxtjs/i18n',
'@nuxtjs/robots',
'@nuxt/image',
'@nuxtjs/device',
'nuxt-gtag',
'nuxt-schema-org',
'nuxt-multi-tenancy',
'@nuxt/scripts',
'@nuxt/icon',
'nuxt-rating',
'@sentry/nuxt/module',
],
sentry: {
debug: true,
sourceMapsUploadOptions: {
org: '',
project: '',
sourcemaps: {
filesToDeleteAfterUpload: ['.output/**/*.map'],
},
authToken:'',
},
},
runtimeConfig: {
public: {
....
},
}
}) |
When disabling sourcemaps, the |
same here, looks like there are reference to source map from the generated file:
|
@afdolriski can you paste your nuxt config here? |
Hi, running into a similiar issue, but using Nuxt 3, I believe the issue is the same though.
There is an option in both nitro and vite that can be set to hide these; in case you don't want to release them publicly. For vite it is set like such in nuxt.config.ts:
And for nitro (note the capital M here):
However, it seems like the Vite is overwritten here:
While nitro is not exactly overwritten, but another output option is added here:
Unsure what exactly happens next, but it seems like since the sourceMappingURL reference exist, Nuxt will add them in the route table (or If we then decide to remove or exclude the sourcemap-files from the release, it causes some issues when e.g. inspecting the JS-files in browser dev tools since this will cause it to try to request the referenced sourcemap-URL. Since the file does not exist on the server, the runtime throws a nasty Perhaps a solution would be to first check if the user has already set the sourcemaps options and respect them before setting them to true? |
@rymdkapten thanks for investigating. We'll discuss an approach forward wrt to forcing sourcemap creation to |
@andreiborza No worries, I just hope it helps! I do agree that |
Hey everyone, we discussed this internally today and opened #13993 to track how we will generate source maps going forward. TL;DR: We'll no longer override explicitly disabled source maps. If no source map generation option is set, we'll enable hidden source maps and delete them afterwards. |
Closing this as this was fixed in this PR: #14020 Feel free to re-open this issue if you are experiencing problems. This will be released with 8.35.0 |
Problem Statement
If source map upload enabled, in production we can see source code (Google Chrome > DevTools > Source) (This is not good)
When source map disable its look like
Solution Brainstorm
Maybe we can generate source map to another folder using separate command?
The text was updated successfully, but these errors were encountered: