fix(dashboard): bundle Monaco editor with inline workers to fix CORS - #4579
Open
koushik717 wants to merge 1 commit into
Open
fix(dashboard): bundle Monaco editor with inline workers to fix CORS#4579koushik717 wants to merge 1 commit into
koushik717 wants to merge 1 commit into
Conversation
Re-applies hatchet-dev#4247 with a fix for the production CORS failure that caused the revert in hatchet-dev#4478. The original PR used Vite's ?worker suffix, which emits workers as separate JS chunks fetched by URL at runtime. In production environments where assets are served with strict CORS headers, those cross-origin worker fetches are blocked, breaking JSON schema autocomplete. This version switches to ?worker&inline, which bundles each worker as a base64 blob URL inside the main chunk. No cross-origin fetch occurs at runtime, so CORS headers on the asset server are irrelevant. Everything else is unchanged from the original PR: monaco-editor is a direct dependency, loader.config({ monaco }) routes @monaco-editor/react to the bundled instance, and MonacoEnvironment.getWorker wires up the editor and JSON workers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@koushik717 is attempting to deploy a commit to the Hatchet Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-applies #4247 with a fix for the production CORS failure that caused the revert in #4478.
Root cause of the revert
The original PR used Vite's
?workersuffix, which emits each worker as a separate JS chunk fetched by URL at runtime. In production environments where assets are served with strict CORS headers, those cross-origin worker URL fetches are blocked by the browser, breaking JSON schema autocomplete.What changed
Switched
?workerto?worker&inlineinmonaco-environment.ts:?worker&inlinebundles each worker as a base64 blob URL inside the main chunk. No cross-origin fetch occurs at runtime, so CORS headers on the asset server are irrelevant.Everything else is unchanged from the original PR.
Testing
pnpm run typecheck- same pre-existing codegen errors as main, no new errorsAI disclosure (per AI_POLICY.md): I used an AI coding assistant for parts of this change and reviewed/tested everything above myself before opening this PR.