@@ -77,8 +77,8 @@ export function warnOptionHasBeenDeprecated(
7777 let found = true
7878 const nestedPropertyKeys = nestedPropertyKey . split ( '.' )
7979 for ( const key of nestedPropertyKeys ) {
80- if ( current [ key ] !== undefined ) {
81- current = current [ key ]
80+ if ( ( current as any ) [ key ] !== undefined ) {
81+ current = ( current as any ) [ key ]
8282 } else {
8383 found = false
8484 break
@@ -168,10 +168,12 @@ export function warnOptionHasBeenMovedOutOfExperimental(
168168 const newKeys = newKey . split ( '.' )
169169 while ( newKeys . length > 1 ) {
170170 const key = newKeys . shift ( ) !
171- current [ key ] = current [ key ] || { }
172- current = current [ key ]
171+ ; ( current as any ) [ key ] = ( current as any ) [ key ] || { }
172+ current = ( current as any ) [ key ]
173173 }
174- current [ newKeys . shift ( ) ! ] = ( config . experimental as any ) [ oldExperimentalKey ]
174+ ; ( current as any ) [ newKeys . shift ( ) ! ] = ( config . experimental as any ) [
175+ oldExperimentalKey
176+ ]
175177 }
176178
177179 return config
@@ -193,7 +195,7 @@ function warnCustomizedOption(
193195 if ( ! ( seg in current ) ) {
194196 return
195197 }
196- current = current [ seg ]
198+ current = ( current as any ) [ seg ]
197199 }
198200
199201 if ( ! silent && current !== defaultValue ) {
@@ -219,16 +221,16 @@ function assignDefaultsAndValidate(
219221 phase : PHASE_TYPE
220222) : NextConfigComplete {
221223 const configFileName = userConfig . configFileName
222- if ( typeof userConfig . exportTrailingSlash !== 'undefined' ) {
224+ if ( typeof ( userConfig as any ) . exportTrailingSlash !== 'undefined' ) {
223225 if ( ! silent ) {
224226 Log . warn (
225227 `The "exportTrailingSlash" option has been renamed to "trailingSlash". Please update your ${ configFileName } .`
226228 )
227229 }
228230 if ( typeof userConfig . trailingSlash === 'undefined' ) {
229- userConfig . trailingSlash = userConfig . exportTrailingSlash
231+ userConfig . trailingSlash = ( userConfig as any ) . exportTrailingSlash
230232 }
231- delete userConfig . exportTrailingSlash
233+ delete ( userConfig as any ) . exportTrailingSlash
232234 }
233235
234236 // Handle migration of experimental.dynamicIO to experimental.cacheComponents
@@ -246,7 +248,7 @@ function assignDefaultsAndValidate(
246248
247249 const config = Object . keys ( userConfig ) . reduce < { [ key : string ] : any } > (
248250 ( currentConfig , key ) => {
249- const value = userConfig [ key ]
251+ const value = ( userConfig as any ) [ key ]
250252
251253 if ( value === undefined || value === null ) {
252254 return currentConfig
@@ -1482,7 +1484,7 @@ export default async function loadConfig(
14821484 validateConfigSchema ( userConfig , configFileName , curLog . warn )
14831485 }
14841486
1485- if ( userConfig . target && userConfig . target !== 'server' ) {
1487+ if ( ( userConfig as any ) . target && ( userConfig as any ) . target !== 'server' ) {
14861488 throw new Error (
14871489 `The "target" property is no longer supported in ${ configFileName } .\n` +
14881490 'See more info here https://nextjs.org/docs/messages/deprecated-target-config'
@@ -1580,7 +1582,7 @@ export default async function loadConfig(
15801582 silent ,
15811583 configuredExperimentalFeatures ,
15821584 phase
1583- ) as NextConfigComplete
1585+ )
15841586
15851587 const finalConfig = await applyModifyConfig ( completeConfig , phase , silent )
15861588
0 commit comments