🐛 Error handling doesn't work and crashes the app
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react-native, typescript
- Domain
- mobile
Research direction
Start with the reproduction in app/example7.tsx and inspect the Rive component's onError path for the listed RNRiveErrorType cases. Run the Example 7 malformed-file scenario on iOS or Android and trace the failure. Done means each error handled by onError reports through the callback without crashing the app.
Written by the indexing model from the issue text.
Description
Description
Hi 👋
<Rive> component allows us (normally) to handle some errors (RNRiveErrorType):
- IncorrectRiveFileUrl
- MalformedFile
- FileNotFound
- IncorrectArtboardName
- UnsupportedRuntimeVersion
- IncorrectStateMachineName
- IncorrectStateMachineInput
But instead of displaying a warning and/or handling error with onError, the app crashes instantly with any of the errors listed above 😕
Example
The app crash instantly with something like that:
const malformedFileUrl =
"https://hatrabbits.com/wp-content/uploads/2017/01/random.jpg";
const correctFileUrl =
"https://public.rive.app/community/runtime-files/2195-4346-avatar-pack-use-case.riv";
export default function Example7() {
const riveRef = useRef<RiveRef>(null);
return (
<Rive
url={malformedFileUrl}
// url={correctFileUrl}
onError={(riveError: RNRiveError) => {
switch (riveError.type) {
case RNRiveErrorType.IncorrectRiveFileUrl: {
console.log(`${riveError.message}`);
return;
}
case RNRiveErrorType.MalformedFile: {
console.log("Malformed File");
return;
}
case RNRiveErrorType.FileNotFound: {
console.log("File not found");
return;
}
case RNRiveErrorType.IncorrectArtboardName: {
console.log("IncorrectAnimationName");
return;
}
case RNRiveErrorType.UnsupportedRuntimeVersion: {
console.log("Runtime version unsupported");
return;
}
case RNRiveErrorType.IncorrectStateMachineName: {
console.log(`${riveError.message}`);
return;
}
case RNRiveErrorType.IncorrectStateMachineInput: {
console.log(`${riveError.message}`);
return;
}
default:
return;
}
}}
/>
);
}
Repository
To reproduce, I created a rive playground: https://github.com/guval-gh/rive-playground
And the last example (Example 7) crash: https://github.com/guval-gh/rive-playground/blob/main/app/example7.tsx
Expected behavior
I expect my log to be displayed in the case of onError:
case RNRiveErrorType.MalformedFile: {
console.log(“Malformed File”);
return;
}
I expect that all the error cases that can be handled via onError won't cause the app to crash.
Screenshots
As soon as I try to go to the screen of the previous example, the app crashes:
https://github.com/user-attachments/assets/80479365-6d88-4dde-8e45-202f42ae766e
Device
- (Screenrecord): iOS Simulator - iOS 18.1
- Crash on iOS Simulator and Android Emulator
Additional context
Crash appear on:
"expo": "^52.0.11",
"react-native": "0.76.3",
"rive-react-native": "^8.2.0",
Also tested on rive-react-native versions: 8.0.0 and 8.1.0
- Dominant language
- TypeScript
- Stars
- 783
- Forks
- 81
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 3
Contributor 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-native
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rive-app/rive-react-native#433 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
rive-app/rive-react-native#431 · 2 comments ·
-
[Android] Rive events dispatched off the UI thread can deadlock with Reanimated under Fabric (ANR) Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
rive-app/rive-react-native#444 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
rive-app/rive-react-native#441 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rive-app/rive-react-native#440 ·
All issues in rive-app/rive-react-native
Similar issues
-
comp/desktop P3 type/bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
NousResearch/hermes-agent#118866 ·
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Plugin stuck at "loading" on DSH 0.1.6-alpha.2 — turnTail list slot registration missing options.id Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
chrisparsons83/flexspotff#153 ·