vercel/next.js · error

Warning: `NextScript` attribute `crossOrigin` is deprecated.

Error message

Warning: `NextScript` attribute `crossOrigin` is deprecated. https://nextjs.org/docs/messages/doc-crossorigin-deprecated

What it means

Development-only warning inside NextScript.render in pages/_document.tsx: before rendering script tags it checks whether this.props.crossOrigin was passed to <NextScript>. That prop is deprecated; cross-origin asset loading should be configured with the top-level crossOrigin next.config.js setting instead.

Source

Thrown at packages/next/src/pages/_document.tsx:920

  }

  render() {
    const {
      assetPrefix,
      buildManifest,
      unstable_runtimeJS,
      docComponentsRendered,
      assetQueryString,
      disableOptimizedLoading,
      crossOrigin,
    } = this.context
    const disableRuntimeJS = unstable_runtimeJS === false

    docComponentsRendered.NextScript = true

    if (process.env.NODE_ENV !== 'production') {
      if (this.props.crossOrigin)
        console.warn(
          'Warning: `NextScript` attribute `crossOrigin` is deprecated. https://nextjs.org/docs/messages/doc-crossorigin-deprecated'
        )
    }

    const files: DocumentFiles = getDocumentFiles(
      this.context.buildManifest,
      this.context.__NEXT_DATA__.page
    )

    return (
      <>
        {!disableRuntimeJS && buildManifest.devFiles
          ? buildManifest.devFiles.map((file: string) => (
              <script
                key={file}
                src={`${assetPrefix}/_next/${encodeURIPath(
                  file
                )}${assetQueryString}`}

View on GitHub (pinned to 0eb3775416)

Solutions

  1. Remove the `crossOrigin` attribute from <NextScript>; it is deprecated.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/next/src/pages/_document.tsx:920 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19). Data as JSON: /api/errors/705dbc48138254cc. Report an issue: GitHub.