Repository navigation
fix(build): write public assets in a stable order - #4975
Conversation
The public asset manifest listed files in the order their reads finished, so two builds of the same app gave different server chunks. Sort the entries by path.
|
@onmax is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Sort manifest entries and verify key order src/build/virtual/public-assets.ts, test/unit/public-assets.test.ts |
The generated manifest sorts asset entries by ID before serialization. The test checks key order for 40 generated public files and removes its temporary directory after each test. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- Issue 4972 reports nondeterministic build output caused by public files being added in read-completion order. This change sorts manifest entries, but does not address copied-file modification times.
Merge Risk: 
Minimal · up to bb07c
-
No actionable merge-blocking risk is identified in this focused ordering change. Merge after normal checks; broader reported test failures remain unattributed.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "fix(build): write public assets in a stable order" follows the Conventional Commits format with a type (fix), a scope (build), and a colon-separated description. It matches the main change: the public-assets manifest is now sorted by asset path before serialization, so the output is stable across builds.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
commit: |
Linked issue
closes #4972
Type of change
Description
Public asset metadata is inserted into the manifest as concurrent file reads finish, so the generated server output can change between identical builds.
Sort the completed manifest by asset path before serializing it, using a locale-independent comparator. Add a regression test that checks the emitted key order.
This addresses manifest ordering only. Copied asset mtimes still vary between builds, and paths that decode to the same key can still overwrite each other according to read completion order. Those need separate fixes.
Checklist