Skip to content

Shared entry filenames are not changing when file contents change causing stale-cache chunk resolution #1125

Description

@burck1

Reproduction of the bug/regression with instructions

We recently ran into the issue identified in #1113. This caused a production outage of our application.

TLDR:

  1. We deployed v1.0 of _foo.<sameHash>.js which had import { z as x } from "@nf-internal/chunk-AAAAAAAA";, which loads chunk-AAAAAAAA.js
  2. Users loaded our app and their browsers cached v1.0 of _foo.<sameHash>.js.
  3. We deployed v1.1 of _foo.<sameHash>.js which had import { z as x } from "@nf-internal/chunk-BBBBBBBB";, which loads chunk-BBBBBBBB.js.
  4. Users loaded our app and since their browsers had a cached version _foo.<sameHash>.js, their browsers then attempted to load chunk-AAAAAAAA.js and failed because either chunk-AAAAAAAA.js didn't exist in the v1.1 deployment, or because the contents of chunk-AAAAAAAA.js changed and doesn't match what v1.0 of _foo.<sameHash>.js expects.

Expected behavior

When file contents for any *.js file in the Angular build output changes, the filename should also change. If the filename doesn't change but the content does, users' browsers and/or CDNs will serve the stale cached content for the file's.

Since @festim-shyti already had a fix here, #1113, and then here, native-federation/native-federation-core#67, but the update was never merged, can the update be backported for v21 of @angular-architects/native-federation?

Versions of Module Federation, Angular, Node, Browser, and operating system

Native Federation: v21
Angular: v21
Node: v24

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions