Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot declare class Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransportFactory, because the name is already in use #39961

Closed
@mahmoodbazdar

Description

@mahmoodbazdar

Symfony version(s) affected: 5.2.1
PHP version: 7.4

Description
I use Symfony/messenger component with DoctrineTransport.
It works great in the dev environment, but I'm getting this error in the prod environment when I want to dispatch a message.

Warning: Cannot declare class Symfony\Component\Messenger\Transport\Doctrine\DoctrineTransportFactory, because the name is already in use

I tried to trace it, and it seems it's because of preload functionality in php7.4, and somehow after cache generation, the DoctrineTransportFactory class was included twice.

Additional context
Sentry log:
https://sentry.io/share/issue/63ed6759822349c4b991b9ea8fc4ab14/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions