Commit 737a873 1 parent c011378 commit 737a873 Copy full SHA for 737a873
File tree 1 file changed +7
-3
lines changed
packages/core/src/puppeteer/tasks
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -99,9 +99,13 @@ export const runLighthouseTask: PuppeteerTask = async (props) => {
99
99
// if the report doesn't exist, we're going to run a new lighthouse process to generate it
100
100
const reportJsonPath = join ( routeReport . artifactPath , ReportArtifacts . reportJson )
101
101
if ( resolvedConfig . cache && fs . existsSync ( reportJsonPath ) ) {
102
- const report = fs . readJsonSync ( reportJsonPath , { encoding : 'utf-8' } ) as Result
103
- routeReport . report = normaliseLighthouseResult ( routeReport , report )
104
- return routeReport
102
+ try {
103
+ const report = fs . readJsonSync ( reportJsonPath , { encoding : 'utf-8' } ) as Result
104
+ routeReport . report = normaliseLighthouseResult ( routeReport , report )
105
+ return routeReport
106
+ } catch ( e ) {
107
+ logger . warn ( `Failed to read cached lighthouse report for path "${ routeReport . route . path } ".` , e )
108
+ }
105
109
}
106
110
107
111
await setupPage ( page )
You can’t perform that action at this time.
0 commit comments