Fix empty HTML/SOG export by forcing splat-transform's worker pool inline#930
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores broken HTML/ZIP viewer exports (and plain SOG export) after the @playcanvas/splat-transform@2.7.1 update by disabling splat-transform’s worker pool in the browser bundle so SOG writing completes reliably.
Changes:
- Import
WorkerQueuefrom@playcanvas/splat-transform. - Configure
WorkerQueue.maxWorkers = 0during app startup to force inline (non-worker) SOG writing and avoid hangs caused by missingworker.mjs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dimitribarbot
added a commit
to dimitribarbot/supersplat
that referenced
this pull request
Jul 2, 2026
Resolve conflicts by adopting upstream's reactive i18n localization (PR playcanvas#927, which removed the free localize()/formatTooltipWithShortcut() helpers) across all fork subsystems: converted ~80 localize() call sites to i18n.t(), using thunk form () => i18n.t() at reactive menu/tooltip sites. Locale files merged (all fork keys kept; upstream's renamed 'panel.view-options' -> Settings + language-selector keys adopted). Kept fork's richer LCC import guard alongside upstream's i18n change. Requires @playcanvas/splat-transform 2.7.1 (upstream dep bump, PR playcanvas#929) which now exports WorkerQueue, used by upstream's inline worker-pool fix (PR playcanvas#930). Verified: npm run lint (clean), npm run build (ok), npm run test (189/189 pass). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Problem
After updating to
@playcanvas/splat-transform@2.7.1andplaycanvas@2.20.2(#929), HTML and ZIP viewer export stopped working: the output file and its.crswaptemp were created on disk but 0 bytes were written, with no error dialog. Plain SOG export was affected too, since all three share the same write path.Root cause
splat-transform 2.6.0 ("Parallelize SOG writing with a cross-platform worker pool") rewired
writeSogto offloadrunQuantize1d/runEncodeWebponto aWorkerQueue. Our 2.5.1 → 2.7.1 bump crossed that change (writeHtmlitself is unchanged between the two versions).In the published build the pool is not inline by default (
WorkerQueue.isInlineisfalse). We never configure it for our browser bundle —main.tsonly setsWebPCodec.wasmUrl— so the pool tries to spawnnew URL('./worker.mjs', import.meta.url), which resolves next to our bundle and 404s (we don't ship that worker). A single failed-worker task falls back to inline correctly, but under the parallel task load that real SOG writing generates, the pool hangs instead of falling back — sowriteSognever completes and nothing is written.Fix
Force SOG writing to run inline (the pre-2.6.0 behavior), alongside the existing
WebPCodecconfig inmain.ts:With the pool disabled, no worker spawn is attempted and writes run on the calling thread, exactly as in 2.5.1.
Verification
tsc --noEmitpasses.maxWorkers = 0.Notes / follow-ups
worker.mjsas a static asset and setWorkerQueue.workerUrlto it.WorkerQueuehangs under parallel load when workers can't spawn, rather than degrading to inline. Forcing inline sidesteps it, but it would bite any browser consumer that enables the pool without shipping the worker.