Fwrite() expects parameter 2 to be string

Hello everyone. I am so confused why this errors popped up I did not even use fwrite on my code

Error

<br />
<b>Fatal error</b>:  Uncaught TypeError: fwrite() expects parameter 2 to be string, boolean given in /home/u475920781/domains/parahanapp.com/public_html/guiguinto/server/parahanap/vendor/slim/psr7/src/Stream.php: 356
Stack trace:
#0 /home/u475920781/domains/parahanapp.com/public_html/guiguinto/server/parahanap/vendor/slim/psr7/src/Stream.php(356): fwrite(Resource id #105, false)
#1 /home/u475920781/domains/parahanapp.com/public_html/guiguinto/server/parahanap/public/index.php(2048): Slim\Psr7\Stream-&gt;write(false)
#2 /home/u475920781/domains/parahanapp.com/public_html/guiguinto/server/parahanap/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(43): {closure
}(Object(Slim\Psr7\Request), Object(Slim\Psr7\Response), Array)
#3 /home/u475920781/domains/parahanapp.com/public_html/guiguinto/server/parahanap/vendor/slim/slim/Slim/Routing/Route.php(381): Slim\Handlers\Strategies\RequestResponse-&gt;__invoke(Object(Closure), Object(Slim\Psr7\Request), Object(Slim\Psr7\Response), Array)
#4 /home/u475920781/domains/parahanapp.com/publi in <b>/home/u475920781/domains/parahanapp.com/public_html/guiguinto/server/parahanap/vendor/slim/psr7/src/Stream.php</b> on line <b>356</b><br />

Can someone explain this to me ? thanks

This error can occur if you pass a boolean instead of a string to the write method. Example:

$response->getBody()->write(false);

So there seems to be an error somewhere before, but it is not recognizable by the error description and the stack trace. I would check with Xdebug where this error occurs.