fix(rollup-plugin): use stable chunk ids in symbol-set mode - #4686
fix(rollup-plugin): use stable chunk ids in symbol-set mode#4686Cypher-Aura-19 wants to merge 2 commits into
Conversation
Use the content-derived createStableChunkId in the default symbol-set renderChunk path so identical builds keep the same chunk id and the same [hash] file names instead of renaming every chunk on every build. Co-Authored-By: Claude <noreply@anthropic.com>
5f88aca to
b396894
Compare
|
cc @PostHog/team-error-tracking i reviewed and fixed an issue, pls double check |
|
@marandaneto we can't use stable chunk ids in symbol set mode because if we do and some chunks are the same across releases, we lose correct release attribution for versions which are still using old chunks. So two things happen here:
In event mode we can do this because release is injected into the chunk and attached to the event (and not fetched from the symbol set) We need to solve this in a different way. I'll think about this. |
ablaszkiewicz
left a comment
There was a problem hiding this comment.
As per my comment above. Let me see what's up with this and come up with a better solution
thanks for the review and good catch |
Problem
The default symbol-set
renderChunkpath injected a random UUID into each chunk before Rollup calculated[hash]filenames. Because the random ID became part of the emitted content, identical builds produced different chunk hashes and renamed every JS chunk on every build, breaking long-term asset caching and causingFailed to fetch dynamically imported moduleerrors on stale tabs.Changes
[hash]filenames@posthog/rollup-pluginTesting
Rollup-plugin unit tests: 26/26 passing
Lint on modified rollup-plugin files: passing
Standalone regression verification confirms:
The Vite functional test cannot run locally on Windows because this repository intentionally installs native bindings only for Linux/macOS; it should run in CI
Closes #4670
Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented with Claude Code under human direction and review. The root cause was confirmed in the default symbol-set
renderChunkpath, the fix is limited to using the existing content-derived chunk-ID helper, and the regression was verified with unit tests and a standalone content-hash check. The Vite functional test was added but could not be executed locally on Windows due to the repository's Linux/macOS-only native binding configuration.