본문으로 건너뛰기
블로그

Firebase Hosting "ChunkLoadError: Loading chunk … failed"

Next.js on Firebase Hosting throws ChunkLoadError after the CVE-2025-55182 WAF rule? How to confirm the cause, what to try, and what to send Firebase support.

The Liite team7분 분량

Short answer

Load your Cloud Run URL and your Hosting domain side by side. If the chunks load on Cloud Run but fail on Hosting, the block sits in front of your app, not in your build. Upgrade Next.js and React to patched releases, retest, and send Firebase support the failing _next URLs if it still fails.

Your Next.js app on Firebase Hosting started breaking in December 2025 and you changed nothing. The page shell loads, then the browser can't fetch the JavaScript under _next, and the console shows this:

ChunkLoadError: Loading chunk … failed

The same app works on its Cloud Run URL, and redeploying didn't help.

Why it happens

A ChunkLoadError only means the page asked for a JavaScript chunk and the request failed. Common causes are a flaky network, an ad blocker, or a stale page that points at chunk files from an older deploy. Your symptoms (Cloud Run fine, Hosting broken, redeploy useless) point somewhere else.

The only evidence for this specific case is a December 2025 thread on the Firebase subreddit. People there report that Google added an automatic WAF rule for the React vulnerability, and that _next chunk requests then failed through Hosting. They also report that React 18 apps, which weren't vulnerable, were hit too, and one suggested fix was upgrading to Next 16.0.7. We found no official Google or Firebase page that explains the rule, which requests it matches, or whether it has changed since. Treat the cause as likely, not proven.

The vulnerability behind the rule is real. On December 3, 2025, the React Team publicly disclosed a critical security vulnerability affecting React Server Components (RSC) and related packages. CVE-2025-55182 has a CVSS score of 10 and is due to unsafe deserialization of payloads from HTTP requests to React Server Function endpoints. That explains why providers shipped emergency filtering. Google's Project Shield help page, for example, says Project Shield blocks this exploit using Cloud Armor. That page is about Project Shield, not Firebase Hosting, so it shows Google filtered for this CVE but does not confirm what Hosting did. A broad rule can catch ordinary traffic by mistake, which would fit what people describe.

CauseSymptomFix
Filter or WAF rule in front of the service (suspected here)Cloud Run URL works, Hosting fails, redeploy changes nothingUpgrade, retest, escalate to Firebase support
Stale page after a deployErrors only for users with an old tab open; a fresh load worksReload; keep old chunks available during rollout
Broken buildChunks fail on Cloud Run tooRebuild from a clean install
Browser extension or network filterFails for one user or one networkTest in a private window on another network
Cache serving old HTMLHTML references chunk hashes that no longer existPurge the cache and redeploy

How to confirm it

  1. Open your Hosting domain in a private window and reload. Note whether the page renders but does nothing when you click.
  2. Open your Cloud Run service URL for the same app. If it works, your build is fine.
  3. Open the browser developer tools, go to the Network tab, and reload the Hosting domain. Filter by _next.
  4. Click each failed request and write down the URL, the status code and any response body. A 403 or a block page suggests a filter. A 404 suggests missing files.
  5. Compare the same file on both URLs. If Cloud Run returns the JavaScript and Hosting returns an error, that matches what people describe.

Tip

Copy a failing chunk URL and open it in a new tab. A plain GET that returns an error page, while the same file loads from Cloud Run, makes a short, clear report for support.

Fixes to try, most likely first

1. Check whether it has already been fixed

The reports date from December 2025, so Google may have changed the rule since. Check the Firebase and Google Cloud status pages and the Firebase release notes, then retest in a private window. If it works now without a deploy, you're done.

2. Upgrade Next.js and React to patched releases

The upgrade matters for security whether or not it clears the chunk errors. For React, CERT-EU says to update affected React Server Components packages to a fixed version (19.0.1, 19.1.2, or 19.2.1). The affected packages are react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack. For Next.js, the thread named 16.0.7 for the 16.0 line. Other lines have their own patched releases, so read the official Next.js security advisory for yours. That advisory is also the place to confirm the current recommended patch, since later advisories can raise the bar. Aim for the newest patch on your line, not a December 2025 number.

Check what you have first:

npm ls next react react-dom

Then update next, react and react-dom together so the lockfile doesn't mix versions, rebuild, redeploy and retest.

Warning

Don't assume you're safe because you're on React 18. Whether the vulnerability applies depends on the React Server Components packages in your lockfile, so check them against the official advisory.

3. Rule out the ordinary causes

If Cloud Run also fails, this isn't the WAF story. Delete .next, rebuild from a clean install and redeploy. If only some users fail, test with extensions off and on another network, and ask whether they had a tab open from before your last deploy.

4. Use Cloud Run as a stopgap

If the site must be up now, share the Cloud Run URL for the time being. It's a workaround, not a fix: it isn't the address your visitors know, and it doesn't repair the Hosting domain.

What won't help

  • Redeploying the same build. People in the thread report no change, which fits a filter in front of your app.
  • Clearing the build cache. The chunks load on Cloud Run, so the output isn't the problem.
  • Asking users to hard-refresh. That only helps stale-deploy errors, not blocked requests.
  • Assuming the version number alone decides it. Reports say non-vulnerable apps were hit too.

Checklist before you contact support

  • The Cloud Run URL loads all _next chunks.
  • The Hosting domain fails on the same chunks in a private window.
  • You have the exact failing URLs and status codes from the Network tab.
  • next, react and react-dom are on patched versions and you've redeployed.
  • You've checked the Firebase and Google Cloud status pages.

If nothing works

Contact Firebase support through the Firebase or Google Cloud console, or through your Google Cloud support plan if you have one. Include the project ID, the Hosting domain, the Cloud Run URL, the failing chunk URLs with status codes, when you saw the failures (with time zone), and the steps above. Here is a message you can adapt:

Subject: Firebase Hosting blocks _next chunks; the Cloud Run URL works

Project ID: <your-project-id>
Hosting domain: <your-domain>
Cloud Run URL: <your-service-url>

Since about <date and time, time zone>, requests for Next.js chunks
under /_next/static/ fail through Firebase Hosting with
"ChunkLoadError: Loading chunk … failed".

Example failing URL: <full chunk URL>
Status code / response: <for example 403 and the body text>

The same chunk loads correctly from the Cloud Run URL.
Redeploying did not change anything.
Next.js version: <version>. React version: <version>.

Could you check whether an automatic WAF rule for CVE-2025-55182
is blocking these requests, and tell us how to get it adjusted?

Common questions

Is my app vulnerable to CVE-2025-55182?

It depends on whether you use React Server Components with an affected version. Next.js App Router is among the confirmed affected components, and the vulnerable React versions are 19.0, 19.1.0, 19.1.1 and 19.2.0. Check your lockfile against the official advisory.

Will upgrading to Next 16.0.7 definitely fix the chunk errors?

No. It was suggested in the thread, and we found nothing confirming it clears the errors for every setup. Upgrade for the security fix, then test.

Why does Cloud Run work when Hosting doesn't?

Hosting sits in front of your service, and the reports blame a rule applied at that layer. Cloud Run reached directly doesn't pass through it. We found no Google explanation.

Could my own code be blocking the chunks?

Only if the chunks also fail on the Cloud Run URL. If they load there, your build and server code are doing their job.