Skip to content

Conversation

@paulirish
Copy link
Member

@paulirish paulirish commented May 26, 2022

Found another one from sentry. (btw it looks like theres only 3 actual JS errors in there. and this is 2 out of 3)

lighthouse https://video.ebscohost.com/results?q=climate%20change -GA

That page loads this JS file which references this map, which is just a {}. It is missing 3 field required by the spec.

But we werent validating these fields are present, leading to a Cannot read properties of undefined (reading 'length') on here:

for (let i = 0; i < sourceMap.map.sources.length; i++) {

image

This change adds the basic validation in the gatherer. As a result, we don't hit the exception. And the user gets the errorMessage in the UI:

image

The audit is still passing cuz it "Only fails if missingMapsForLargeFirstPartyFile is true. All other errors are diagnostical."

@paulirish paulirish requested a review from a team as a code owner May 26, 2022 18:30
@paulirish paulirish requested review from brendankenny and removed request for a team May 26, 2022 18:30
@connorjclark connorjclark changed the title core(sourcemap): flag sourcemaps that are just an object core(source-maps): throw explicit error when map is missing required fields May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants