vercel icon indicating copy to clipboard operation
vercel copied to clipboard

[next] return plain text 404 for `/_next/static/`

Open devjiwonchoi opened this issue 1 year ago • 2 comments

Why?

When bots like Googlebot crawl a site, it gets the asset paths /_next/static/... from the <link> and <script> tags. As those asset paths may change over time, when Googlebot tries to sync the resources, it reaches a 404 page.

The problem is that Next.js returns an HTML 404 page, which lets bots consider that they've found an invalid 404 page.

How?

Return content type as plain text instead of HTML.

x-ref: https://github.com/vercel/next.js/pull/75111

devjiwonchoi avatar Jan 23 '25 22:01 devjiwonchoi

🦋 Changeset detected

Latest commit: 115ecd41c2b5cbd8d2c18d99d4edae41992b8d1c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@vercel/next Patch
vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jan 23 '25 22:01 changeset-bot[bot]

This stack of pull requests is managed by Graphite. Learn more about stacking.

devjiwonchoi avatar Jan 23 '25 22:01 devjiwonchoi