dustin10 / VichUploaderBundle

A simple Symfony bundle to ease file uploads with ORM entities and ODM documents.
MIT License
1.85k stars 519 forks source link

OPCache Preload Error, Unknown Parent #1270

Closed mbopp closed 2 years ago

mbopp commented 2 years ago

Bug Report

Q A
BC Break yes/no
Bundle version 1.19
Symfony version 5.4
PHP version 8.1

Summary

When using on opcache.preload = /app/config/preload.php on platform.sh, I receive the following error(s) when building the project.

[17-Feb-2022 17:58:14 UTC] PHP Warning:  Can't preload unlinked class Vich\UploaderBundle\Form\Type\VichFileType: Unknown parent Symfony\Component\Form\AbstractType in /app/vendor/vich/uploader-bundle/src/Form/Type/VichFileType.php on line 27
[17-Feb-2022 17:58:14 UTC] PHP Warning:  Can't preload unlinked class Vich\UploaderBundle\Form\Type\VichImageType: Unknown parent Vich\UploaderBundle\Form\Type\VichFileType in /app/vendor/vich/uploader-bundle/src/Form/Type/VichImageType.php on line 21
[17-Feb-2022 17:58:14 UTC] PHP Warning:  Can't preload unlinked class Vich\UploaderBundle\Form\Type\VichFileType: Unknown parent Symfony\Component\Form\AbstractType in /app/vendor/vich/uploader-bundle/src/Form/Type/VichFileType.php on line 27

Current behavior

See above

How to reproduce

Turn on opcache.preload by pointing it to symfony's preload script.

Expected behavior

Ability to use symfony's preload w/out error.

garak commented 2 years ago

Are you requiring symfony/form in your composer.json?

mbopp commented 2 years ago

@garak I am not requiring symfony/form, as this is a "API only" project. Perhaps this is the issue?

mbopp commented 2 years ago

Adding symfony/form is the confirmed solution.