@@ -268,7 +268,22 @@ export function create_client({ target, base, trailing_slash }) {
268
268
navigation_result . props . page . url = url ;
269
269
}
270
270
271
- root . $set ( navigation_result . props ) ;
271
+ if ( import . meta. env . DEV ) {
272
+ // Nasty hack to silence harmless warnings the user can do nothing about
273
+ const warn = console . warn ;
274
+ console . warn = ( ...args ) => {
275
+ if (
276
+ args . length !== 1 ||
277
+ ! / < ( L a y o u t | P a g e ) > w a s c r e a t e d w i t h u n k n o w n p r o p ' ( d a t a | e r r o r s ) ' / . test ( args [ 0 ] )
278
+ ) {
279
+ warn ( ...args ) ;
280
+ }
281
+ } ;
282
+ root . $set ( navigation_result . props ) ;
283
+ tick ( ) . then ( ( ) => ( console . warn = warn ) ) ;
284
+ } else {
285
+ root . $set ( navigation_result . props ) ;
286
+ }
272
287
} else {
273
288
initialize ( navigation_result ) ;
274
289
}
@@ -347,11 +362,30 @@ export function create_client({ target, base, trailing_slash }) {
347
362
348
363
page = result . props . page ;
349
364
350
- root = new Root ( {
351
- target,
352
- props : { ...result . props , stores } ,
353
- hydrate : true
354
- } ) ;
365
+ if ( import . meta. env . DEV ) {
366
+ // Nasty hack to silence harmless warnings the user can do nothing about
367
+ const warn = console . warn ;
368
+ console . warn = ( ...args ) => {
369
+ if (
370
+ args . length !== 1 ||
371
+ ! / < ( L a y o u t | P a g e ) > w a s c r e a t e d w i t h u n k n o w n p r o p ' ( d a t a | e r r o r s ) ' / . test ( args [ 0 ] )
372
+ ) {
373
+ warn ( ...args ) ;
374
+ }
375
+ } ;
376
+ root = new Root ( {
377
+ target,
378
+ props : { ...result . props , stores } ,
379
+ hydrate : true
380
+ } ) ;
381
+ console . warn = warn ;
382
+ } else {
383
+ root = new Root ( {
384
+ target,
385
+ props : { ...result . props , stores } ,
386
+ hydrate : true
387
+ } ) ;
388
+ }
355
389
356
390
if ( router_enabled ) {
357
391
const navigation = { from : null , to : new URL ( location . href ) } ;
0 commit comments