github-actions[bot] opened a new pull request, #67556: URL: https://github.com/apache/airflow/pull/67556
* UI: Fix Monaco workers crashing in production mode `?url` does not run the Vite worker pipeline. For `editor.worker.js` it inlines the raw source as a base64 data URL (the source is below the default `assetsInlineLimit`), and the inlined module still has bare specifier imports it cannot resolve in a Worker context. For `json.worker.js` it copies a partly-bundled file whose top-level `import '../../editor/editor.worker.js'` resolves to a path that does not exist in the build output. Both cases manifest at runtime as "Could not create web worker(s). Falling back to loading web worker code in main thread" followed by a stream of fallback fetch errors. Switch to `?worker&url`: Vite runs the file through the worker pipeline (bundling all dependencies into a self-contained IIFE) and the URL query suffix returns the resulting URL as a string instead of a Worker constructor. The Blob shim from #67352 then imports a properly bundled worker, restoring real worker-thread execution. * UI: Rewrite modulepreload hrefs to the api-server static path Vite emits both `<script src="./assets/...">` and `<link rel="modulepreload" href="./assets/...">` for chunks in the built `index.html`. The `transform-url-src` plugin only rewrote `src="./assets/"` to `src="./static/assets/"`, leaving the modulepreload `href`s untouched. Behind the api-server's `/static/` mount those preload requests hit the SPA HTML fallback and the browser fails them with `Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "text/html"`. The chunks themselves still load via `<script src>` so the app works, but every page load wastes three round-trips on the failed preloads and floods the console. Apply the same `static/` rewrite to `href="./assets/"` and switch all three rewrites to `replaceAll` so multiple matches (one per chunk) are handled — `replace` with a string only touches the first occurrence. --------- (cherry picked from commit eff567c7e607ecd744d4ec4dc5e7a6fedb33663c) Co-authored-by: Pierre Jeambrun <[email protected]> Co-authored-by: Rahul Vats <[email protected]> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
