Fix MapErrorEvent type to match MapLibre error payload shape - #181
Merged
Conversation
Supersedes the Dependabot prod-minor-patch group bump (#179), whose CI failed type-check: maplibre-gl 6.3.0 made map events typed, and the 'error' event now carries an ErrorLike ({ message }) instead of a full Error. Loosen MapStyleManager's local MapErrorEvent interface to match, so handleMapError accepts the event payload again. Lockfile-only dependency update within the existing package.json ranges (^6.0.0 / ^4.4.1), same as the Dependabot PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ogXnGFhdAVkg5C6GA2gFi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Corrects the
MapErrorEventinterface inMapStyleManager.tsto accurately reflect how MapLibre types error payloads. Theerrorproperty is now typed as anErrorLikeobject with optionalmessageandstatusfields, rather than a fullErrorinstance.Changes
MapErrorEvent.errortype fromError & { status?: number }to{ message?: string; status?: number }ErrorLike({ message }), not a fullErrorobjectAJAXErroraddsstatusand source errors addsourceId/tileto this base shapeDetails
This change aligns the TypeScript type definition with MapLibre GL's actual error event structure. MapLibre's type definitions use an
ErrorLikeinterface for error payloads rather than the standardErrorclass, which only guarantees amessageproperty. Thestatusfield is conditionally added byAJAXErrorevents. This fix prevents type mismatches when handling MapLibre error events in the map style manager.https://claude.ai/code/session_016ogXnGFhdAVkg5C6GA2gFi