`useRiveFile` does not handle errors thrown in RiveFile constructor
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
Start at the useRiveFile hook and compare its error path with the try/catch around new RiveFile in js/src/rive.ts at lines 1817-1824. Review the RiveFile initData path around lines 1453-1457 and verify that a loading failure produces the hook's failed status without an uncaught error crashing the app.
索引モデルが issue の本文から書いたものです。
説明
I want to use the status returned by the useRiveFile hook to fail gracefully if there is an error while loading the file, e.g. if the file at src is missing.
Currently, if there is an error during the initData method of RiveFile, firing the loadError event is immediately followed by throwing an Error (https://github.com/rive-app/rive-wasm/blob/55691eb4893e3056f2d5096fbc3f2e58142e8d79/js/src/rive.ts#L1453-L1457).
This makes the status returned by useRiveFile provide little value for this use case, since if status === 'failed', the app is going to crash anyways.
This is not an issue when using useRive without useRiveFile, because the call to new RiveFile is wrapped in a try / catch in the Rive constructor (https://github.com/rive-app/rive-wasm/blob/55691eb4893e3056f2d5096fbc3f2e58142e8d79/js/src/rive.ts#L1817-L1824).
I think similarly, useRiveFile should also catch errors thrown by new RiveFile. Without this error handling, I don't think I can use useRiveFile in production.
Other work-arounds also welcome!
Thank you!
- 主要言語
- TypeScript
- スター
- 1.2k
- フォーク
- 58
- 平均マージ
- 52分
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rive-app/rive-react のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
rive-app/rive-react#410 · コメント 1 件 ·
-
Fit.Layout doesn't reflow elements in canvas-lite対応中かも @usero-agent が 127 日前に担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
rive-app/rive-react#409 · コメント 3 件 ·
-
Issue: Re-mount RiveComponent multiple times cause web page laggy対応中かも @usero-agent が 127 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
rive-app/rive-react#400 ·
-
triage
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
rive-app/rive-react#392 ·
-
triage
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
rive-app/rive-react#386 · リアクション 1 件 ·
rive-app/rive-react の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
better-auth/better-auth#11723 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: docs difficulty: easy documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Worker-Erstellung bricht langsame Git-Worktree-Checkouts nach 20 Sekunden ab対応中かも @KajoVanBuyten が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
AgentSystemLabs/agent-office#367 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pierrecomputer/pierre#1187 ·
メンテナーはふだん 1 日以内に返信
-
area: frontend bug
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
snapotter-hq/SnapOtter#2425 ·
メンテナーはふだん 1 日以内に返信