Skip to content
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

Request::getPayload(): Return value must be of type Symfony\Component\HttpFoundation\InputBag, Symfony\Component\HttpFoundation\ParameterBag returned #51108

Closed
pixopa opened this issue Jul 26, 2023 · 3 comments

Comments

@pixopa
Copy link

pixopa commented Jul 26, 2023

Symfony version(s) affected

symfony/http-foundation 6.3.1

Description

ERROR: Symfony\Component\HttpFoundation\Request::getPayload(): Return value must be of type Symfony\Component\HttpFoundation\InputBag, Symfony\Component\HttpFoundation\ParameterBag returned {"exception":"[object] (TypeError(code: 0): Symfony\Component\HttpFoundation\Request::getPayload(): Return value must be of type Symfony\Component\HttpFoundation\InputBag, Symfony\Component\HttpFoundation\ParameterBag returned at /Users/amitshinde/dev/swagify/users-service/vendor/symfony/http-foundation/Request.php:1517)

How to reproduce

Upgrade to latest version symfony/http-foundation and when trying to make a basic controller request, we are getting this error -

Symfony\Component\HttpFoundation\Request::getPayload(): Return value must be of type Symfony\Component\HttpFoundation\InputBag, Symfony\Component\HttpFoundation\ParameterBag returned {"exception":"[object] (TypeError(code: 0): Symfony\Component\HttpFoundation\Request::getPayload(): Return value must be of type Symfony\Component\HttpFoundation\InputBag, Symfony\Component\HttpFoundation\ParameterBag returned at ../vendor/symfony/http-foundation/Request.php:1517)

Possible Solution

This section is causing the problem and returning ParameterBag instead of InputBag -

if ($this->request->count()) {
return clone $this->request;
}

Additional Context

No response

@HypeMC
Copy link
Contributor

HypeMC commented Jul 26, 2023

Are you using Laravel by any chance? I'm asking because this exact bug was recently fixed on their side, see laravel/framework#47838

@vaites
Copy link

vaites commented Jul 26, 2023

Seems to be a Laravel issue. For now the solution is to downgrade symfony/http-foundation.

@xabbuh
Copy link
Member

xabbuh commented Jul 26, 2023

closing then

@xabbuh xabbuh closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2023
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

5 participants