Lighthouse Plugin doesn't work without hacks
See original GitHub issueI created a sample project with a Lighthouse Plugin for my blogpost: https://engineering.q42.nl/making-a-lighthouse-plugin-work-with-lighthouse-ci/.
I couldn’t get it to work on GitHub Actions without adding the lines:
- run: npm install lighthouse
- run: mv node_modules/lighthouse-plugin-social-sharing
Otherwise it gave te error messages:
Runtime error encountered: Cannot find module 'lighthouse'
Runtime error encountered: Unable to locate plugin: lighthouse-plugin-field-social-sharing
My sample repo is: https://github.com/Q42/lighthouse-plugin-sample-project
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Making a Lighthouse Plugin work with Lighthouse CI
Below you can find an implementation with the hacks to get the Lighthouse Plugin working. The code can also be found on this...
Read more >lighthouse/plugins.md at main - GitHub
At its core, a plugin is a node module that implements a set of checks that will be run by Lighthouse and added...
Read more >What Is Google Lighthouse and How to Use It?
Are you looking to enhance the performance of your website? Learn how you can use the free automated tool Google Lighthouse to do...
Read more >How To Get a 100 In Google Lighthouse - Wetopi
Google Lighthouse Audit Can Help You Improve Your WordPress Performance. Improve Your Lighthouse Score By Following Our Recommendations.
Read more >Continuous Performance Analysis with Lighthouse CI and ...
All you need to do is update the staticDistDir option to wherever your build is located. When the Lighthouse CI is run, it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great work, thanks for the fix! I also updated my blogpost.
I forked your repo - thanks for setting that up and making it real easy to dig into.
https://github.com/connorjclark/lighthouse-plugin-sample-project
few things here:
npm install
to get the packages the you declare in yourpackage.json
node_modules
). When your project’s action doesuses: treosh/lighthouse-ci-action@v2
, the copy of Lighthouse that runs is in a totally different directory (-run: ls -a
helped me understand that). Node’s resolution strategy won’t have access to it, so…node_modules
seems like the least hacky option.I believe we can avoid this hairy issue pretty simply. This treosh action should accept a parameter
extra_modules
, which it will callnpm install
for each. Those modules will then live alongside the bundled modules, and will be in the right spot. @exterkamp, sg?