Handle Windows WASM memory allocation errors with user-friendly message#2704
Closed
sejas wants to merge 6 commits intorelease/1.7.5from
Closed
Handle Windows WASM memory allocation errors with user-friendly message#2704sejas wants to merge 6 commits intorelease/1.7.5from
sejas wants to merge 6 commits intorelease/1.7.5from
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
apps/studio/src/lib/tests/wasm-memory-error.test.ts
1 task
Member
Author
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.

Related issues
Proposed Changes
Studio displayed an error,
WordPress server process exited unexpectedly, on Windows when a user started or created a site with low available RAM. That behaviour has been improved in Playground CLI 3.1.4, but I think it is worth adding this heuristic to guide the user to stop some sites. This also adds more error strings that I encountered when starting a site on Windows; it was not common, but I saw them about once every 10 tries.This PR:
isWasmMemoryError()helper function inipc-handlers.tsthat detects WASM memory allocation failures through:createSiteandstartServercatch blocks to use the new helperWASM_ERROR_NOT_ENOUGH_MEMORYwhich the renderer already handles by showing a user-friendly "Not enough memory" dialogContext: Windows doesn't overcommit memory like macOS. When multiple WordPress sites are running via PHP WASM, Windows fails to allocate memory for new WASM instances and the server process crashes. Previously, users saw a generic "verify your site's local path directory" error instead of a helpful memory message.
Testing Instructions
npm starton Windows'Cannot allocate Wasm memory for new instance'check still works)Pre-merge Checklist