Open duanejevon opened 2 years ago
Not knowing much about modern PHP, I found a way to fix this by removing the type hint entirely:
wp2static/src/Crawler.php:234
- 'rejected' => function ( RequestException $reason, $index ) use ( $urls ) {
+ 'rejected' => function ( $reason, $index ) use ( $urls ) {
Hi @joelw. Your fix resolved the issue for me. Thank you!
Description
When running the Crawl process, the following error appears:
PHP Fatal error: Uncaught TypeError: WP2Static\Crawler::WP2Static\{closure}(): Argument #1 ($reason) must be of type WP2StaticGuzzleHttp\Exception\RequestException
To Reproduce
PHP Fatal error: Uncaught TypeError: WP2Static\Crawler::WP2Static\{closure}(): Argument #1 ($reason) must be of type WP2StaticGuzzleHttp\Exception\RequestException
Screenshots If applicable, add screenshots to help explain your problem.
Environment:
Linux ip-172-31-23-216 4.19.0-20-cloud-amd64 #1 SMP Debian 4.19.235-1 (2022-03-17) x86_64 GNU/Linux
Log files:
See attached wp2static-logs.txt
Additional Context Initial attempts (as shown in the logs) were made using the wp2static 7.1.7 version of the plugin. After experiencing a few bugs and googling them, i found that the latest version resolved these bugs. I composed and upgraded the plugin.