WKWebView WebGL not working in MacOS 11 (Catalyst)?

Hey!

I'm trying to load a map using MapBox GL JS in a WebView, and it works on iOS/iPadOS. But not on MacOS.

It does render all HTML elements and JavaScript is enabled as well.

When I inspect the WebView of the app, I get these 2 errors:
Code Block javascript
WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost
WebGL: INVALID_OPERATION: loseContext: context already lost

I have tried to find solutions on the internet, but those solutions where deprecated or doesn't work anymore.


I'm using
  • SwiftUI

  • Xcode 12 Beta 6

  • iOS 14 Beta 6

  • MacOS 11 Beta 5

I hope someone here does have a solution 🙂