Netlify Lighthouse package build error

Hi,

When using netlify build locally, I always get the following error:

Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 404)

I know this is because the Lighthouse package installed in my netlify.toml file:

[[context.production.plugins]]
package = "@netlify/plugin-lighthouse"

Is there a way to prevent this? I know removing the package will do so, but that’s of course not what I want.

Gr,

Andy

1 Like

Is your site accessible when the plugin runs?

1 Like

@hrishikesh no not yet, I can understand that. That’s why I want to prevent te plugin from running when doing a local build.

1 Like

Hi, @andylemaire. The workflow I would use is to use two copies of that TOML file and swap the default one for one missing the package = "@netlify/plugin-lighthouse" lines when building locally. I would do so using scripts bundled with the repo itself not manually (although, you could do it manually if you wanted to).