next.js
8be5a3c2 - [turbopack] Fix CSS HMR on Safari (#92123)

Commit
51 days ago
[turbopack] Fix CSS HMR on Safari (#92123) Fixes #91818 **Regression source:** Commit `b7e4c6a011` ("Turbopack: transpile CHUNK_SUFFIX") introduced `getChunkSuffixFromScriptSrc()` which reads query strings from `<script>` tags. On Safari, this picks up the `?ts=` param injected by the server-side cache-busting workaround in `render.tsx` (for [WebKit #187726](https://bugs.webkit.org/show_bug.cgi?id=187726)), baking it into `ASSET_SUFFIX`. This causes HMR CSS URLs to match the preloaded URL exactly, re-triggering the Safari preload cache bug and preventing style updates. **Changes:** - **`dev-backend-dom.ts`**: Match existing `<link>` elements by base path (strip query string) so selectors work across HMR updates with different `?ts=` values. Add Safari to the Firefox cache-busting branch so new stylesheet links always get a fresh `?ts=`. - **`hmr-client.ts`**: Fix `mergeChunkUpdates` so a `total` update always supersedes any prior update type.
Author
Parents
Loading