emscripten-core / emscripten-core/emscripten

Uncaught TypeError in setCanvasElementSizeCallingThread

Offen
#20,246 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
27.6k
Forks
3.6k
Ø Merge
1 T. 6 Std.
Gemergte PRs (30 T.)
109

Beschreibung

The error says

`Uncaught TypeError: Cannot read properties of null (reading '0')`

The error comes from the code below.

```js
var autoResizeViewport = false;
if (canvas.GLctxObject && canvas.GLctxObject.GLctx) {
var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978);
autoResizeViewport =
prevViewport[0] === 0 &&
prevViewport[1] === 0 &&
prevViewport[2] === canvas.width &&
prevViewport[3] === canvas.height;
}
```

It seems prevViewport is 0.

I'm not really familiar with the js side. Is the js file that contains `setCanvasElementSizeCallingThread` generated by emsdk? I'm not sure if this is an emsdk issue or a user issue.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.