-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Cannot find module 'lighthouse/lighthouse-core/lib/environment.js' #5
Comments
Thanks for flagging this, @skloiber-sz. I'll check what we've changed upstream in Lighthouse and get this patched up in the module. |
Is there a quick workaround before I dig too deep into this? |
Same issue here. Any workaround at the moment? |
any news on this? |
This module is broken at the moment. It will need some work to fix up. Most of https://github.com/addyosmani/webpack-lighthouse-plugin/blob/master/src/lighthouse-bin.js can be nuked and replaced with https://github.com/GoogleChrome/lighthouse/tree/b354890076f2c077c5460b2fa56ded546cca72ee/docs#using-programmatically effectively. I know addy is pretty busy right now.. Anyone wanna give this a shot? |
My fault. Sorry for dropping the ball on this folks!
If someone would like to help with a PR to update the plugin to use https://github.com/GoogleChrome/lighthouse/tree/b354890076f2c077c5460b2fa56ded546cca72ee/docs#using-programmatically directly that would be mucho awesome. If not, I'll try to make some progress later in the week on rewriting. |
I'd love to help out, so I had a look at the code with the intention of fixing it. Ideally I think that functionality should be extracted from lighthouse-cli/bin.ts to lighthouse-core (in the lighthouse repo). But to get this plugin working again I would instead need to copy that functionality from lighthouse-cli/bin.ts to this plugin before using the example code from the docs (similar to what Addy has done already, so code would just slightly change). |
Unless I'm mistaken I believe you're right. cc'ing in @samccone in case we're missing something obvious.
Let's wait to hear from @paulirish and/or @samccone before doing this. On the Lighthouse side they've supportive of folks not needing to copy large pieces of functionality (a problem in the past) but I'm unsure short-term how much room there would be for them to add-in the other features we're using above. Thanks for any time you're able to commit to helping here @carlkenne. With some luck we'll get a little clarity on next steps soon. |
Ah I see. looks like you're saving results to disk. Gotcha. Assuming that's something we want to continue to do here... i have an alternate proposal: You could use Based on what's currently needed from this plugin, that actually seems totally compatible. If you wanted to process the JSON results yourself, you'd need to pick and choose these methods a bit more. |
Alright, I tried it and it works. |
@carlkenne that seems good. in the future we'd like to improve consuming the module, so we'll use the implementation you do here as guidance for what public API we should expose. |
@paulirish I tried it out in a real project today and failed. It makes sense since I'm not using the command line and this code expects you to. |
cc @ebidel |
with GoogleChrome/lighthouse#2602 complete, this should be much more straightforward. something like this: const runLighthouse = require('lighthouse/lighthouse-cli/run.js').runLighthouse;
const flags = {
port: 0,
chromeFlags: '',
output: 'html'
};
runLighthouse(url, flags).then(results => {
results....
}); The above requires this PR to land, but that should happen by the time you read this. :) It will get the JSON passed back so you can evaluated it, but it'll also save the HTML report to disk. |
got this error this morning after giving lighthouse a shot in my webpack config. any thoughts on when this may be fixed? |
I'll get a fix to this by tomorrow @benjaminhoffman , sorry for the delay |
Thanks Even! Sorry for the delays in replies folks. Traveling for work at.
…On Sep 24, 2017 2:23 AM, "Even Stensberg" ***@***.***> wrote:
I'll get a fix to this by tomorrow @benjaminhoffman
<https://github.com/benjaminhoffman> , sorry for the delay
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGxaTtGZTXnjvN6idWNUnXk9PxTYOpoks5slT6qgaJpZM4L-fbb>
.
|
#7 Done |
Hi Addy,
when requiring the plugin in the webpack.config file and executing webpack I get this error message:
It seems that the node compatibility check was removed from lighthouse core.
Thanks,
Stefan
The text was updated successfully, but these errors were encountered: