Skip to content

[Bug]: entryFileNames hash is the same despite different content #3453

@heypiotr

Description

@heypiotr

Reproduction link or steps

https://stackblitz.com/edit/github-uuqzkgke

This repro:

  • uses a plugin for loading modules over HTTP + resolving imports from an import map
  • bundles a simple site generated by www.framer.com, mainScript.js is the entrypoint
  • uses entryFileNames: '[name].[hash].js'
  • bundles twice on npm run build, into dist1 and dist2

What is expected?

The hash and the content of the generated mainScript.<hash>.js are either both the same between runs, or both different between runs.

What is actually happening?

The hash stays the same between runs, but the content changes:

$ diff dist1 dist2
diff dist1/mainScript.CL3rqqnv.js dist2/mainScript.CL3rqqnv.js
23c23
< 		page: lazy(() => import("./xOoeiNxXJ-DcsILB3N.js")),
---
> 		page: lazy(() => import("./xOoeiNxXJ-DGT-bFBs.js")),
Only in dist2: xOoeiNxXJ-DGT-bFBs.js
Only in dist1: xOoeiNxXJ-DcsILB3N.js

For reference, the changes in xOoeiNxXJ are trivial are probably explained by the fact that loading files from the network can change the order in which the files get processed from build to build? Which is fine, but in this case I'd expect the generated entrypoint to have a different hash.

$ diff dist1/xOoeiNxXJ-DcsILB3N.js dist2/xOoeiNxXJ-DGT-bFBs.js
6c6
< import { className, className$1, className$2, css, css$1, css$2, fonts, fonts$1, fonts$2 } from "./kccnzi2pd-CYycPYLn.js";
---
> import { className, className$1, className$2, css as css$1, css$1 as css, css$2, fonts as fonts$1, fonts$1 as fonts$2, fonts$2 as fonts } from "./kccnzi2pd-CYycPYLn.js";
268c268
< 	...css$1,
---
> 	...css,
270c270
< 	...css
---
> 	...css$1
341d340
< 	...getFontsFromSharedStyle(fonts$1),
343c342,343
< 	...getFontsFromSharedStyle(fonts)
---
> 	...getFontsFromSharedStyle(fonts),
> 	...getFontsFromSharedStyle(fonts$1)

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    rolldown: latest => 1.0.0-beta.3

Any additional comments?

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions