mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Move errorOnce imports into statements guarded by process.env.NODE_ENV === 'development' (#94782)
See https://github.com/vercel/next.js/pull/94781; cc @icyJoseph
This commit is contained in:
@@ -22,7 +22,6 @@ import {
|
||||
FetchStrategy,
|
||||
type PrefetchTaskFetchStrategy,
|
||||
} from '../components/segment-cache/types'
|
||||
import { errorOnce } from '../../shared/lib/utils/error-once'
|
||||
|
||||
type Url = string | UrlObject
|
||||
type RequiredKeys<T> = {
|
||||
@@ -767,6 +766,8 @@ export default function LinkComponent(
|
||||
|
||||
if (legacyBehavior) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
const { errorOnce } =
|
||||
require('../../shared/lib/utils/error-once') as typeof import('../../shared/lib/utils/error-once')
|
||||
errorOnce(
|
||||
'`legacyBehavior` is deprecated and will be removed in a future ' +
|
||||
'release. A codemod is available to upgrade your components:\n\n' +
|
||||
|
||||
@@ -18,7 +18,6 @@ import { useIntersection } from './use-intersection'
|
||||
import { getDomainLocale } from './get-domain-locale'
|
||||
import { addBasePath } from './add-base-path'
|
||||
import { useMergedRef } from './use-merged-ref'
|
||||
import { errorOnce } from '../shared/lib/utils/error-once'
|
||||
|
||||
type Url = string | UrlObject
|
||||
type RequiredKeys<T> = {
|
||||
@@ -707,6 +706,8 @@ const Link = React.forwardRef<HTMLAnchorElement, LinkPropsReal>(
|
||||
|
||||
if (legacyBehavior) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
const { errorOnce } =
|
||||
require('../shared/lib/utils/error-once') as typeof import('../shared/lib/utils/error-once')
|
||||
errorOnce(
|
||||
'`legacyBehavior` is deprecated and will be removed in a future ' +
|
||||
'release. A codemod is available to upgrade your components:\n\n' +
|
||||
|
||||
Reference in New Issue
Block a user