You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pierrejeambrun (via GitHub)" <gi...@apache.org> on 2026/05/26 11:14:05 UTC
[PR] UI: Fix Monaco workers crashing in production mode [airflow]
pierrejeambrun opened a new pull request, #67546:
URL: https://github.com/apache/airflow/pull/67546
Follow-up to #67352. In production builds, the Monaco editor was unable to spawn its web workers — Chrome logged `Could not create web worker(s). Falling back to loading web worker code in main thread.` plus MIME-type errors for `editor/editor.worker.js`, and the JSON editor in XComs / Audit Log was running everything (syntax service, folding) on the UI thread.
### Root cause
#67352 switched the worker imports from `?worker` to `?url` so a Blob shim could re-import them same-origin. `?url`, however, does **not** run Vite's worker pipeline:
- For `editor.worker.js` (the entry source is ~1 KB), `?url` inlines the **raw** module as a base64 data URL via `build.assetsInlineLimit`. The inlined module still contains bare-specifier imports (`vs/editor/...`) that cannot be resolved inside a module Worker.
- 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.
In both cases the Worker fails to evaluate, Monaco's fallback path kicks in, and the unhashed `editor/editor.worker.js` URL Monaco tries next hits the SPA HTML fallback (the MIME error).
### Fix
Switch the imports to `?worker&url`. Vite's worker plugin runs the file through the full worker pipeline (bundling all dependencies into a self-contained IIFE), and the `&url` suffix returns the bundled file's URL as a string instead of a Worker constructor — which is what the Blob shim needs.
Verified the rebuilt `dist/` now contains self-contained workers (`editor.worker-<hash>.js` ≈ 260 KB, `json.worker-<hash>.js` ≈ 390 KB, zero top-level imports), with small URL-wrapper modules pointing at them.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 4.7)
Generated-by: Claude Code (Opus 4.7) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] UI: Fix Monaco workers crashing in production mode [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #67546:
URL: https://github.com/apache/airflow/pull/67546#issuecomment-4544745739
### Backport failed to create: v3-2-test. View the failure log <a href='https://github.com/apache/airflow/actions/runs/26452623725'> Run details </a>
Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.
In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>❌</td>
<td>v3-2-test</td>
<td><a href="https://github.com/apache/airflow/commit/021606f0837069da5e6674ca55b3531b77abb8be"><img src='https://img.shields.io/badge/Commit-021606f-red' alt='Commit Link'></a></td>
</tr>
</table>
You can attempt to backport this manually by running:
```bash
cherry_picker 021606f v3-2-test
```
This should apply the commit to the v3-2-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.
After you have resolved the conflicts, you can continue the backport process by running:
```bash
cherry_picker --continue
```
If you don't have cherry-picker installed, see the [installation guide](https://github.com/apache/airflow/blob/main/dev/README.md#how-to-backport-pr-with-cherry-picker-cli).
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] UI: Fix Monaco workers crashing in production mode [airflow]
Posted by "choo121600 (via GitHub)" <gi...@apache.org>.
choo121600 commented on PR #67546:
URL: https://github.com/apache/airflow/pull/67546#issuecomment-4544077678
nit, I wonder if some comments could be shortened a bit, but this is non-blocking
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] UI: Fix Monaco workers crashing in production mode [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #67546:
URL: https://github.com/apache/airflow/pull/67546#issuecomment-4543832164
I'm opening a follow up PR for the unrelated console errors we see in the 'prod' example.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] UI: Fix Monaco workers crashing in production mode [airflow]
Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 merged PR #67546:
URL: https://github.com/apache/airflow/pull/67546
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org