question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lighthouse Plugin doesn't work without hacks

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
roelfjancommented, Dec 23, 2019

Great work, thanks for the fix! I also updated my blogpost.

2reactions
connorjclarkcommented, Nov 21, 2019

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:

  1. You must run npm install to get the packages the you declare in your package.json
  2. This treosh action bundles its own version of Lighthouse (and a bunch of other stuff in its node_modules). When your project’s action does uses: 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…
  3. Copying the plugin module you install to this treosh action’s bundled 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 call npm install for each. Those modules will then live alongside the bundled modules, and will be in the right spot. @exterkamp, sg?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found