Back to all fixes
CuratedTypeScriptVite 8local
@vitejs/plugin-legacy: legacy chunks never load on Safari 15.x and below
Problem
With `@vitejs/plugin-legacy`, browsers on Safari 15.x (and earlier) fail to load the legacy fallback chunks even though they should be served modern-browser-detection determines the browser as modern when it isn't, or the legacy path silently never executes. Root cause: a genuine Safari 15.x engine bug (related to WebKit commit 92ba524) where an error thrown inside a module is only triggered once; the plugin's browser-detection module relies on repeatedly triggering the same error pattern, which breaks on affected Safari versions.
Solution
typescript
Fixed by vitejs/vite PR #22028 (merged), titled 'fix(legacy): workaround safari 15 error caching bug' - it makes each legacy-detection module unique so Safari's once-only error firing no longer breaks detection. Upgrade to the Vite release containing PR #22028. The author tested the fix specifically against Safari 15.6 and confirmed it resolves the false-negative modern-browser detection.