Skip to content

Fix MapErrorEvent type to match MapLibre error payload shape - #181

Merged
amorfinv merged 1 commit into
mainfrom
claude/issue-179-wzqmo0
Aug 19, 2026
Merged

Fix MapErrorEvent type to match MapLibre error payload shape#181
amorfinv merged 1 commit into
mainfrom
claude/issue-179-wzqmo0

Conversation

@amvlab

@amvlab amvlab commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

Corrects the MapErrorEvent interface in MapStyleManager.ts to accurately reflect how MapLibre types error payloads. The error property is now typed as an ErrorLike object with optional message and status fields, rather than a full Error instance.

Changes

  • Updated MapErrorEvent.error type from Error & { status?: number } to { message?: string; status?: number }
  • Updated JSDoc comment to clarify that MapLibre types the error payload as ErrorLike ({ message }), not a full Error object
  • Documented that AJAXError adds status and source errors add sourceId/tile to this base shape

Details

This change aligns the TypeScript type definition with MapLibre GL's actual error event structure. MapLibre's type definitions use an ErrorLike interface for error payloads rather than the standard Error class, which only guarantees a message property. The status field is conditionally added by AJAXError events. This fix prevents type mismatches when handling MapLibre error events in the map style manager.

https://claude.ai/code/session_016ogXnGFhdAVkg5C6GA2gFi

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
@amorfinv
amorfinv merged commit e94855c into main Aug 19, 2026
2 checks passed
@amorfinv
amorfinv deleted the claude/issue-179-wzqmo0 branch August 19, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants