Open rodolforjunior opened 1 year ago
So, the error is in your project and not in the library?
So, the error is in your project and not in the library?
It definitely must be.
I'm asking since the results I've found on forums and other related sources are mostly vague.
Any clues what this might be related?
It's a bad character in a json. Dump the data used to generate the json or check it using a debugger in real time.
... so you're telling me that this line:
$browser = $browserFactory->createBrowser();
causes
(...)
"file": "path\vendor\symfony\http-foundation\JsonResponse.php",
"line": 51,
"function": "setData",
"class": "Illuminate\Http\JsonResponse",
"type": "->"
? I find that hard to believe, but can you make a small reproducible script?
Does this script reproduce the crash for you?
<?php
require_once __DIR__ . "/vendor/autoload.php";
$browserFactory = new \HeadlessChromium\BrowserFactory();
$browser = $browserFactory->createBrowser();
die("end of script");
This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions.
Hello. I'm building a Laravel project trying to capture screenshots and create PDF of specific parts of my app. I've tried running different libraries like Browsershot and Snappy, but the error of malformed characters persist on all of them. It could be a problem with specific characters of the pages I'm trying to screen, however testing on public url's like google returns the same response error.
Is there anyone else who at least had or managed to resolve this issue? I tried running a new project only to test the libraries and the problem persists. Another coworker of mine tried running the project and libraries on his machine and had different, but very confusing and unclear errors.
Below is a sample:
The error in question:
{ "message": "Malformed UTF-8 characters, possibly incorrectly encoded", "exception": "InvalidArgumentException", "file": "path\vendor\laravel\framework\src\Illuminate\Http\JsonResponse.php", "line": 91, "trace": [ { "file": "path\vendor\symfony\http-foundation\JsonResponse.php", "line": 51, "function": "setData", "class": "Illuminate\Http\JsonResponse", "type": "->" }, }