| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
View your CI Pipeline Execution ↗ for commit 7d8ead3
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at 2026-09-10 00:05:23 UTC |
Sorry, something went wrong.
npm i https://pkg.pr.new/@nativescript/core@11425 npm i https://pkg.pr.new/@nativescript/vite@11425 npm i https://pkg.pr.new/@nativescript/webpack@11425 commit: 7d8ead3 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Checklist
What is the current behavior?
dynamicImportPlugin replaces Vite's browser __vitePreload helper (which touches document and window) with a native one, but it does so from generateBundle using a literal regex on the identifier. With build.minify: 'esbuild' Vite's vite:esbuild-transpile plugin has already renamed __vitePreload in renderChunk, so the regex misses, the browser helper ships, and its window.dispatchEvent in the rejection path turns every failed dynamic import into ReferenceError: window is not defined with a misattributed stack. Details in #11423.
What is the new behavior?
The transform runs in renderChunk as an enforce: 'post' plugin. User post plugins run before buildPlugins.post (where the esbuild minifier lives), so the helper is still named when it is replaced. renderChunk returns null when nothing changed, so untouched chunks and already-transformed code are left alone. transformDynamicImports is unchanged.
Specs cover the plugin shape (post + renderChunk, no generateBundle), the replacement through renderChunk, and the no-op/idempotent return.
Verified with a real ns build ios of a blank Vue app with build.minify: 'esbuild': the emitted bundle contains the native helper and no vite:preloadError / document.createElement("link"); the published 8.0.5 bundle has the reverse. At runtime a deliberately failing import() now reports the real load error.
Fixes #11423.