Open vladutt opened 10 months ago
Knp\Snappy\AbstractGenerator.php Line: 629
Generated file name C:\Windows\Temp\test.html
array:2 [▼ // routes\ext.routes\dev.php:12
"scheme" => "C"
"path" => "\Windows\Temp_est.html"
]
protected function prepareOutput($filename, $overwrite)
{
if (false === $parsedFilename = \parse_url($filename)) {
throw new InvalidArgumentException('The output filename is invalid.');
}
$scheme = isset($parsedFilename['scheme']) ? \mb_strtolower($parsedFilename['scheme']) : '';
Same bug with 1.4.8 version and PHP: 7.4
Any solution?
Tested with all versions of 0.4.* and get the same error
Tested with all versions of 0.4.* and get the same error
on 1.4.1 can't be the same error. Because the code which check schema it's not present. Test carefully what version did you installed. Maybe you can try to delete vendor and composer-lock.json.
In your composer the package should be without '^'. like this
"knplabs/knp-snappy": "1.4.1",
I have the same problem. However, the bug itself belongs to KnpLabs/snappy and not barryvdh/laravel-snappy. See: https://github.com/KnpLabs/snappy/issues/489
A bug fix is already in the works and will be in the next release. The last version took 6 months, so I can't say when this will happen.
So here is a workaround that works just as well.
Add the following line to your composer.json require block:
"knplabs/knp-snappy": "1.4.2 as 1.4.3"
.
This will map version 1.4.3 to version 1.4.2.
After that, you need to do one of the following things:
composer update
composer update knplabs/knp-snappy
-- The best optionI should be able to release a fix this week. The fix is ready and it's waiting for couple more reviews https://github.com/KnpLabs/snappy/pull/490 Feel free to review it yourself, sorry for the issue.
Fix released, I've added a test pipeline for Windows to avoid OS related issues to happen again.
It works now, thanks!
Hello. On version 1.4.3 of knplabs/knp-snappy we got this error.
The output file scheme is not supported. Expected '' or 'file' but got 'c.
The solution was to change the version back to 1.4.1
Also we tried to update version of laravel-snappy as well to 1 from 0.4.8, but without any results.
Server: Windows IIS PHP: 8.1.13