docs(docs-infra): guard sandbox reset before initialization in playground#68221
docs(docs-infra): guard sandbox reset before initialization in playground#68221erkamyaman wants to merge 1 commit intoangular:mainfrom
Conversation
…ound changeTemplate() was calling reset() on the sandbox before init() completed, causing a TypeError when spawning processes on an uninitialized WebContainer. Add isSandboxReady signal to skip reset until the sandbox is fully initialized.
|
The error: content_script_bundle.js:1 Attempting handshake with backend Wed Apr 15 2026 19:11:47 GMT+0300 (GMT+03:00) |
docs(docs-infra): guard sandbox reset before initialization in playground
changeTemplate() was calling reset() on the sandbox before init() completed, causing a TypeError when spawning processes on an uninitialized WebContainer. Add isSandboxReady signal to skip reset until the sandbox is fully initialized.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When the playground component initializes, an
effectfireschangeTemplate()which callsreset()on theNodeRuntimeSandboxbeforeinit()has completed. This causes aTypeError: Cannot read properties of undefined (reading 'spawn')because the WebContainer instance hasn't been created yet. This error is reproducible on angular.dev/playground in production.Issue Number: N/A
What is the new behavior?
A
isSandboxReadysignal is added that is set totrueonly afterinit()completes.changeTemplate()now checks this signal before callingreset(), preventing the TypeError during initial load.Does this PR introduce a breaking change?
Other information