Skip to content

Commit fa9376c

Browse files
authored
fix(nuxt): Don't override Nuxt options if undefined (#15795)
Sometimes, the build fails because of this error: ` ERROR Cannot set property options of #<Object> which has only a getter ` As `nuxt.options` are always defined anyway (it's also not optional in the `Nuxt` type), we can safely delete the assertion to `{}` which causes the error to dissapear.
1 parent 9cdd2d9 commit fa9376c

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

packages/nuxt/src/vite/sourceMaps.ts

-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ export function changeNuxtSourceMapSettings(
142142
nuxt: Nuxt,
143143
sentryModuleOptions: SentryNuxtModuleOptions,
144144
): { client: UserSourceMapSetting; server: UserSourceMapSetting } {
145-
nuxt.options = nuxt.options || {};
146145
nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };
147146

148147
let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {

0 commit comments

Comments
 (0)