How to catch wasm runtime loading error?
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
Start by tracing RiveFile initialization through file.init(), then compare its failure path with useRive's onLoadError and the window error handlers shown in the report. Determine where a failed rive.wasm load is surfaced and verify that the loading failure reaches a documented catch or error callback while the Suspense example behaves predictably.
由索引模型根据 Issue 内容生成。
描述
Let's say there's no network connection while loading rive.wasm, how do I able to know there's an error loading wasm?
window.onerror = () => {
// won't catch wasm loading error
}
window.onunhandledrejection = () => {
// won't catch wasm loading error
}
const loadingRiveFile = (async () => {
const file = new RiveFile({ src: '...' })
try {
await file.init()
} catch {
// won't catch wasm loading error
}
return file
})()
function MyComponent() {
const riveFile = use(loadingRiveFile)
const { RiveComponent } = useRive({
riveFile,
onLoadError: () => {
// won't catch wasm loading error
}
})
return (
// ...
)
}
function App() {
return (
<Suspense fallback={'loading...'}>
<MyComponent />
</Suspense>
)
}
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 58
- 平均合并
- 52 分钟
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 于 123 天前认领。 未关闭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 于 123 天前认领。 未关闭
难度 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 个 reaction ·
查看 rive-app/rive-react 的全部 Issue
相似的 Issue
-
[Bug]: Server git tests sign fixture commits with the developer's key when run from the repo root未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
melgarafael/DeskcommCRM#2657 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
MystenLabs/MemWal#1163 · 2 条评论 ·
维护者通常 1 天内回复
-
Mondriaan
难度 1/5 1 小时以内 新手友好度 88/100
knaw-huc/textannoviz#709 ·
维护者通常 1 天内回复
-
billion-context-pi
难度 2/5 1-3 小时 新手友好度 62/100
ranxianglei/billion-context#2521 · 3 条评论 ·
维护者通常 1 天内回复