fix(build): disable custom codeSplitting that crashed the release bundle (black screen) - #613
Merged
su-fen merged 1 commit intoAug 25, 2026
Conversation
A recent build config added `rolldownOptions.output.codeSplitting` with a `liveagent-app` group. That custom chunking split the `style-to-js → style-to-object → inline-style-parser` CommonJS interop chain across chunks. rolldown's `__commonJSMin` thunks then failed to initialize across the chunk boundary, so the release bundle crashed at render time with `require_cjs$N is not a function` — a black screen with an AppErrorBoundary, while `tauri dev` (no chunk splitting) worked fine. Set `codeSplitting: false` to fall back to rolldown's default automatic chunking, which keeps that CJS chain in one chunk. Verified the release exe launches and renders correctly after the change.
Member
|
谢谢宝宝~ |
su-fen
added a commit
to AlphaCatMeow/LiveAgent
that referenced
this pull request
Aug 25, 2026
su-fen
added a commit
to AlphaCatMeow/LiveAgent
that referenced
this pull request
Aug 25, 2026
跨大版本 override(1.1.21→2.0.2,消费方 hast-util-to-jsx-runtime 声明 ^1.0.0) 的触发条件是旧 vite 配置的激进代码分割;合并 Stack-Cairn#613 后产物不再分包, override 失去存在理由,保留只剩兼容性风险。SkillCategoryControls 的 惰性求值修复无害,保留。 Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
The release (
tauri build) bundle crashed on launch with a black screen andAppErrorBoundaryshowingrequire_cjs$N is not a function, whiletauri devworked fine. This fixes it by disabling the customcodeSplittingconfig that split a CommonJS interop chain across chunks.Closes #612.
Root cause
crates/agent-gui/vite.config.tsrecently addedbuild.rolldownOptions.output.codeSplittingwith aliveagent-appgroup. That custom chunking split thestyle-to-js → style-to-object → inline-style-parserCommonJS chain across chunks. rolldown wraps CJS modules in__commonJSMinthunks, and across a chunk boundary those thunks weren't initialized before the call site ran — sorequire_cjs$Nwasundefinedat render time →require_cjs$N is not a function.tauri devdoes no chunk splitting, so the chain stays in one module and works — which is why this slipped pasttsc, tests, and dev.In the broken bundle:
Fix
Set
codeSplitting: falseto fall back to rolldown's default automatic chunking, which keeps that CJS chain in one chunk.chunkSizeWarningLimitis kept so the known-large Monaco workers don't spam the console.Verification
Built the release exe (
pnpm tauri build --no-bundle) and confirmed:style-to-js/style-to-object/inline-style-parsernow land in the same chunk; the cross-chunkas require_cjs$Nnamed import is gone.target/release/liveagent.exe) launches and renders correctly — no black screen, noAppErrorBoundary.Test plan
pnpm tauri build --no-bundle→ runtarget/release/liveagent.exe→ app renders (was: black screen).pnpm tauri devstill works (unaffected — dev never split chunks).chunkSizeWarningLimit).Notes
test: /[\/]\.pnpm[\/](?:style-to-js|style-to-object|inline-style-parser)@/) was attempted first but didn't reliably captureinline-style-parser; default chunking is more robust.