Skip to content

[Serializer] Fatal error: Class 'Symfony\Component\PropertyAccess\PropertyAccess' not found #20588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
johnpancoast opened this issue Nov 22, 2016 · 9 comments
Assignees

Comments

@johnpancoast
Copy link

Using symfony/serializer: "~3.1" in my project and got that error when using the ObjectNormalizer. Seems that serializer component is dependent on PropertyAccess but there's no requirement in composer.

@johnpancoast
Copy link
Author

johnpancoast commented Nov 22, 2016

Hmm I guess the docs say that you need to add the dependency on property access yourself if you want to use that normalizer.

@hefekranz
Copy link

super bad.

@weaverryan
Copy link
Member

Hmm, seems we could probably add a check for the class a better exception if it's not found. @dunglas there are quite a few optional deps inside symfony/serializer - what do you think about adding some more explicit checks when optional deps are used in the code?

@dunglas
Copy link
Member

dunglas commented Oct 13, 2017

Why not, but it's already explicitly stated in the suggest section of composer.json: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Serializer/composer.json#L45

@fabpot
Copy link
Member

fabpot commented Oct 13, 2017

We are throwing specific exception for such cases in other places in the framework, I think it's better than having a PHP error. By the way, the suggest section of composer.json is not really useful here.

@dunglas
Copy link
Member

dunglas commented Oct 13, 2017

Ok I'll open a PR to add exceptions.

@dunglas dunglas reopened this Oct 13, 2017
@dunglas dunglas self-assigned this Oct 13, 2017
@hefekranz
Copy link

Thanks guys!

@nicolas-grekas
Copy link
Member

friendly reminder @dunglas

@dunglas
Copy link
Member

dunglas commented Nov 27, 2017

@nicolas-grekas the related PR has already been merged #24563. Closing.

@dunglas dunglas closed this as completed Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants