Skip to content

fix: check if webgl is enabled and call onerror otherwise#297

Open
meesfrensel wants to merge 1 commit into
dimfeld:masterfrom
meesfrensel:fix/webgl-support
Open

fix: check if webgl is enabled and call onerror otherwise#297
meesfrensel wants to merge 1 commit into
dimfeld:masterfrom
meesfrensel:fix/webgl-support

Conversation

@meesfrensel

Copy link
Copy Markdown

Fixes #279 by checking for WebGL support before trying to create the map.

As reported in the bug, the svelte app can completely freeze when webgl is disabled, and a MapLibre component is created without a <svelte:boundary> to contain errors. It's better to just check it ourselves, and report errors to the consumer via the onerror callback.

isWebglSupported is basically a copy from https://maplibre.org/maplibre-gl-js/docs/examples/check-if-webgl-is-supported/

@changeset-bot

changeset-bot Bot commented Apr 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 93a3ae0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte-maplibre Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Apr 17, 2026

Copy link
Copy Markdown

@meesfrensel is attempting to deploy a commit to the Daniel Imfeld's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

onerror not called when WebGL is disabled

1 participant