symfony / ux

Symfony UX initiative: a JavaScript ecosystem for Symfony
https://ux.symfony.com/
MIT License
834 stars 303 forks source link

[LiveComponent] is displayed in an iframe with id "live-component-error" after change #1061

Closed CharlyPoppins closed 1 year ago

CharlyPoppins commented 1 year ago

Hi,

I'm using Live Component alike the example https://ux.symfony.com/live-component/demos/auto-validating-form.

Then after changing a select value, the component is re-rendered in a iframe with id "live-component-error".

Found the meaning in node_modules/@symfony/ux-live-component/dist/live_controller.js

test is : if (headers.get('Content-Type') !== 'application/vnd.live-component+html' && !headers.get('X-Live-Redirect')) {

and my headers.get('Content-Type') is text/html; charset=utf-8, application/vnd.live-component+html

In profiler response seams ok:

content-type | "application/vnd.live-component+html"

In Chrome console response headers has two entries for Content-Type :

Content-Type:
application/vnd.live-component+html

Content-Type:
text/html; charset=utf-8

I don't figure out why...

CharlyPoppins commented 1 year ago

symfony composer update solve the issue, Something has changes in amphp/socket, amphp/sync or doctrine/dbal that fixed the issue.