dunglas / frankenphp

🧟 The modern PHP app server
https://frankenphp.dev
MIT License
6.88k stars 235 forks source link

FrankenPHP does not work with symfony ux autocomplete #683

Closed pyatnitsev closed 7 months ago

pyatnitsev commented 7 months ago

What happened?

Sentry log is

image

I use https://ux.symfony.com/autocomplete with standard doctrine. first request when coursor pointed to field was ok, but no one more. All next requests ends with 500 error with log, that I have attached above.

This issue related to worker mode. I disable it, now autocomplete works file.

So, I can create a minimal app, that reproduce issue.

Build Type

Docker (Alpine)

Worker Mode

Yes

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

I use latest PHP version of official docker image.

Relevant log output

No response

withinboredom commented 7 months ago

It looks like this library won't support worker mode and needs to be architected so that information isn't shared between requests. In this case, it looks like it registers a singleton in the container, expecting it to be cleaned up after the request is done.

This isn't a frankenphp bug, you should open an issue with them

bpacholek commented 3 months ago

Hi @pyatnitsev I can confirm what @withinboredom said that this is related to the fact that these instances are not re-set on each request when in worker mode which causes setOptions to be executed on a preconfigured form. As a temporary workaround I have suggested a decorator in the symfony/ux issue log: https://github.com/symfony/ux/issues/1649#issuecomment-2234864882