-
Notifications
You must be signed in to change notification settings - Fork 630
SendGrid\\Client::makeRequest(): Argument #3 ($body) must be of type ?array, SendGrid\\Mail\\Mail give #1124
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
Comments
Can confirm. I am receiving the same error response when attempting to send messages. This was working on previous releases. Full error message below.
|
The error appears to be resulting from line 511 in
probably should be:
Note: the docblock above it is outdated as well on line 503 |
After digging through https://github.com/sendgrid/php-http-client repo, it appears this should be handled over there since the affected code is not in this repo: sendgrid/php-http-client#170. |
@DanRyan483 It has been broken at least since 8.1.9, I am trying to go back to the last working version. |
I am getting this issue when we updated our dependencies today. However, our productions are still working on 8.1.2 |
However, when updating our local environments back down to 8.1.2, it still throws this error |
Does this #1123 fix the issue? |
I haven't had the chance to check #1123. For now, I have temporarily forced sendgrid/php-http-client to 4.1.1 via composer on my repo to get around the issue until it gets patched.
From what I can tell, the issue is just a declaration problem in the makeRequest() method (see my previous notes). After rolling back to 4.1.1 everything appears to be working as expected. Edit: just for refererence, I'm pretty sure this issue was triggered by the following commit (see line 511): sendgrid/php-http-client@c859858 |
Facing this problem here (PHP 8.1) - SendGrid version 8.1.2 up to 8.1.11 give the same error. Using 8.1.1 here works as before. |
I'm getting same error since yesterday. "php": "^7.3|^8.0",
|
Hi! We are working on fixing this. Will be releasing the fixed version at the earliest |
I have raised a PR to fix this. Will get this merged and release the new version of php-http-client that should solve this issue. Thanks! |
I think you can update the send function in this package and serialize the email if u want to keep the type in the other package: |
I think we would like to figure out better ways to get the deprecation out as well as not breaking anything. So, will create a separate PR for new changes |
For those still mentioning their version of The workaround is specifically adding Its nice to see the SendGrid PHP libraries getting some much needed work, but its concerning such a serious breaking bug got through and had to be reported by end users. |
is it resolved? |
It seems that the pull request has not been approved yet: #1123 |
Hi! We have released the fixed version of php-http-client. Please check now and let me know if there are still any issues. Thanks! |
PHP 8.4
SendGrid 8.1.11
I get this error message when sending an email:
SendGrid\Client::makeRequest(): Argument #3 ($body) must be of type ?array, SendGrid\Mail\Mail give called in /var/www/html/my-project/vendor/sendgrid/php-http-client/lib/Client.php on line 662
My code:
The text was updated successfully, but these errors were encountered: