How to catch wasm runtime loading error?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
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.
Written by the indexing model from the issue text.
Description
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>
)
}
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 58
- Avg merge
- 3h 26m
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rive-app/rive-react
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
rive-app/rive-react#410 · 1 comment ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 42/100
rive-app/rive-react#409 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
rive-app/rive-react#400 ·
-
triage
Difficulty 3/5 1-2 days Newbie friendliness 45/100
rive-app/rive-react#392 ·
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 55/100
rive-app/rive-react#386 · 1 reaction ·
All issues in rive-app/rive-react
Similar issues
-
level/task reporter/qa type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
wazuh/wazuh-dashboard-plugins#9310 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cybersemics/treecrdt#267 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
wiz-sec-public/backstage-plugin-wiz#16 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
solana-foundation/solana-com#2245 ·
Maintainers usually reply within 1 day