core(source-maps): throw explicit error when map is missing required fields #14060
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:lighthouse/lighthouse-core/audits/valid-source-maps.js
Line 97 in 94b4f38
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:
The audit is still passing cuz it "Only fails if
missingMapsForLargeFirstPartyFile
is true. All other errors are diagnostical."