AJAX webform inside a Canvas component returns full HTML page instead of AjaxResponse when render cache is disabled
When an AJAX-enabled Webform is embedded in a Canvas component (e.g. an SDC that renders `webform_block` via `drupal_block()`), submitting the form returns the **full HTML page** instead of a JSON `AjaxResponse`. The browser's `ajax.js` then throws `Drupal.AjaxError` / `parsererror` (HTTP 200, `StatusText: parsererror`). The returned HTML also contains a swallowed `Twig\Error\RuntimeError occurred during rendering of component <uuid> ... An exception has been thrown during the rendering of a template ("") in "<theme>:form" at line 1` (logged by `RenderSafeComponentContainer`). The form still processes server-side (submission saved, email sent); only the response format is wrong. **This only happens when the `render` cache bin uses `cache.backend.null`** (the configuration shipped in core's `example.settings.local.php` / standard dev setup). With a real render backend it works (so on production it works just fine). **Steps to reproduce** 1. Standard dev settings: `$settings['cache']['bins']['render'] = 'cache.backend.null';` 2. Embed an AJAX-enabled webform in a Canvas component (`webform_block` inside an SDC, with or without `lazy`). 3. Submit the form. Response is the full HTML page → `parsererror` in console. **Proof it's Canvas-specific (not Webform)** Same webform, same AJAX setting, same null render cache: * Rendered on its **own** webform page → AJAX returns proper JSON (works). * Rendered **inside a Canvas component** → AJAX returns full HTML (broken). **Environment:** Drupal 11.x, Canvas 1.5.0, Webform 6.3.0-rc1. **AI Disclaimer:** After a long debug session and going back and forth I asked my AI Agent to make a summary to post this issue. I've reread the output, changed and deleted all unneeded information to keep it as brief and correct as can be.
issue