Replies: 4 comments 5 replies
-
same error, fresh laravel 9 install, using sail and adding the chromium-browser to de dockerfile |
Beta Was this translation helpful? Give feedback.
-
It looks like lighthouse latest version (10) converted from CommonJS to ES modules which is a breaking change. A quick way to get this to work as-is is to |
Beta Was this translation helpful? Give feedback.
-
It might be noteworthy to add something to the documentation about the lighthouse package version requirement. |
Beta Was this translation helpful? Give feedback.
-
I'll investigate this soon, I'd like to be up to date with Lighthouse 10. If any of you already knows what needs to be changed, I'd accept a PR. If breaking changes are needed to support Lighthouse 10, I'd be willing to tag a new major version of the package. |
Beta Was this translation helpful? Give feedback.
-
Could you help me check the issue with error log
[2023-02-10 05:11:26] development.ERROR: Could not run Lighthouse. Error : `E:\MyProjects\theseotool.site\vendor\spatie\lighthouse-php\bin\lighthouse.js:1
const lighthouse = require('lighthouse');
^
Error [ERR_REQUIRE_ESM]: require() of ES Module E:\MyProjects\theseotool.site\node_modules\lighthouse\core\index.js from E:\MyProjects\theseotool.site\vendor\spatie\lighthouse-php\bin\lighthouse.js not supported.
Instead change the require of index.js in E:\MyProjects\theseotool.site\vendor\spatie\lighthouse-php\bin\lighthouse.js to a dynamic import() which is available in all CommonJS modules.
at Object. (E:\MyProjects\theseotool.site\vendor\spatie\lighthouse-php\bin\lighthouse.js:1:20) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v18.12.1
{"exception":"[object] (Spatie\\Lighthouse\\Exceptions\\CouldNotRunLighthouse(code: 0): Could not run Lighthouse. Error :
E:\MyProjects\theseotool.site\vendor\spatie\lighthouse-php\bin\lighthouse.js:1const lighthouse = require('lighthouse');
Beta Was this translation helpful? Give feedback.
All reactions