File tree Expand file tree Collapse file tree
components/http-access-fallback Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import { AppRouterContext } from '../../shared/lib/app-router-context.shared-run
77import { useMergedRef } from '../use-merged-ref'
88import { isAbsoluteUrl } from '../../shared/lib/utils'
99import { addBasePath } from '../add-base-path'
10- import { warnOnce } from '../../shared/lib/utils/warn-once'
1110import { ScrollBehavior } from '../components/router-reducer/router-reducer-types'
1211import type { PENDING_LINK_STATUS } from '../components/links'
1312import {
@@ -513,6 +512,8 @@ export default function LinkComponent(
513512 const formattedHref = formatStringOrUrl ( resolvedHref )
514513
515514 if ( process . env . NODE_ENV !== 'production' ) {
515+ const { warnOnce } =
516+ require ( '../../shared/lib/utils/warn-once' ) as typeof import ( '../../shared/lib/utils/warn-once' )
516517 if ( props . locale ) {
517518 warnOnce (
518519 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ import {
1919 getAccessFallbackErrorTypeByStatus ,
2020 isHTTPAccessFallbackError ,
2121} from './http-access-fallback'
22- import { warnOnce } from '../../../shared/lib/utils/warn-once'
2322import { MissingSlotContext } from '../../../shared/lib/app-router-context.shared-runtime'
2423
2524interface HTTPAccessFallbackBoundaryProps {
@@ -62,6 +61,8 @@ class HTTPAccessFallbackErrorBoundary extends React.Component<
6261 // A missing children slot is the typical not-found case, so no need to warn
6362 ! this . props . missingSlots . has ( 'children' )
6463 ) {
64+ const { warnOnce } =
65+ require ( '../../../shared/lib/utils/warn-once' ) as typeof import ( '../../../shared/lib/utils/warn-once' )
6566 let warningMessage =
6667 'No default component was found for a parallel route rendered on this page. Falling back to nearest NotFound boundary.\n' +
6768 'Learn more: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs\n\n'
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ import type {
2626} from '../shared/lib/image-config'
2727import { imageConfigDefault } from '../shared/lib/image-config'
2828import { ImageConfigContext } from '../shared/lib/image-config-context.shared-runtime'
29- import { warnOnce } from '../shared/lib/utils/warn-once'
3029import { RouterContext } from '../shared/lib/router-context.shared-runtime'
3130
3231// This is replaced by webpack alias
@@ -116,6 +115,8 @@ function handleLoading(
116115 onLoadingCompleteRef . current ( img )
117116 }
118117 if ( process . env . NODE_ENV !== 'production' ) {
118+ const { warnOnce } =
119+ require ( '../shared/lib/utils/warn-once' ) as typeof import ( '../shared/lib/utils/warn-once' )
119120 const origSrc = new URL ( src , 'http://n' ) . searchParams . get ( 'url' ) || src
120121 if ( img . getAttribute ( 'data-nimg' ) === 'fill' ) {
121122 if ( ! unoptimized && ( ! sizesInput || sizesInput === '100vw' ) ) {
Original file line number Diff line number Diff line change 1- import { warnOnce } from './utils/warn-once'
21import { getAssetToken , getDeploymentId } from './deployment-id'
32import { getImageBlurSvg } from './image-blur-svg'
43import { imageConfigDefault } from './image-config'
@@ -462,6 +461,8 @@ export function getImgProps(
462461 const qualityInt = getInt ( quality )
463462
464463 if ( process . env . NODE_ENV !== 'production' ) {
464+ const { warnOnce } =
465+ require ( './utils/warn-once' ) as typeof import ( './utils/warn-once' )
465466 if ( config . output === 'export' && isDefaultLoader && ! unoptimized ) {
466467 throw new Error (
467468 `Image Optimization using the default loader is not compatible with \`{ output: 'export' }\`.
Original file line number Diff line number Diff line change 33import React , { useContext , type JSX } from 'react'
44import Effect from './side-effect'
55import { HeadManagerContext } from './head-manager-context.shared-runtime'
6- import { warnOnce } from './utils/warn-once'
76
87export function defaultHead ( ) : JSX . Element [ ] {
98 const head = [
@@ -129,6 +128,8 @@ function reduceComponents(
129128 . map ( ( c : React . ReactElement < any > , i : number ) => {
130129 const key = c . key || i
131130 if ( process . env . NODE_ENV === 'development' ) {
131+ const { warnOnce } =
132+ require ( './utils/warn-once' ) as typeof import ( './utils/warn-once' )
132133 // omit JSON-LD structured data snippets from the warning
133134 if ( c . type === 'script' && c . props [ 'type' ] !== 'application/ld+json' ) {
134135 const srcMessage = c . props [ 'src' ]
Original file line number Diff line number Diff line change 1- import { warnOnce } from '../../utils/warn-once'
2-
31/**
42 * Run function with `scroll-behavior: auto` applied to `<html/>`.
53 * This css change will be reverted after the function finishes.
@@ -24,6 +22,8 @@ export function disableSmoothScrollDuringRouteTransition(
2422 process . env . NODE_ENV === 'development' &&
2523 getComputedStyle ( htmlElement ) . scrollBehavior === 'smooth'
2624 ) {
25+ const { warnOnce } =
26+ require ( '../../utils/warn-once' ) as typeof import ( '../../utils/warn-once' )
2727 warnOnce (
2828 'Detected `scroll-behavior: smooth` on the `<html>` element. To disable smooth scrolling during route transitions, ' +
2929 'add `data-scroll-behavior="smooth"` to your <html> element. ' +
You can’t perform that action at this time.
0 commit comments