emscripten-core / emscripten-core/emscripten

Uncaught TypeError in setCanvasElementSizeCallingThread

オープン
#20,246 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
27.6k
フォーク
3.6k
平均マージ
1日 16時間
マージ済み PR(30日)
117

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、生成された JavaScript で setCanvasElementSizeCallingThread を見つけ、それを生成している emsdk のソースと比較します。prevViewport が null またはゼロになる報告されたケースを再現し、viewport の検索で期待される動作を特定します。TypeError の原因が説明され、動作が検証された時点で issue は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, wasm
領域
compilers, web-dev
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。