Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: catch RiveFile initialization error in hook #269

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

damzobridge
Copy link
Contributor

This PR addresses the issue with the useRiveFile hook not properly catching RiveFile initialization errors.

Copy link
Contributor

@bodymovin bodymovin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@damzobridge damzobridge merged commit 9b02c0f into main Jun 21, 2024
1 check passed
@damzobridge damzobridge deleted the bugfix/267/handle-rive-file-initialization-error branch June 21, 2024 16:14
@petersli
Copy link

thank you so much! 🙌 will there be a patch release for this?

@damzobridge
Copy link
Contributor Author

thank you so much! 🙌 will there be a patch release for this?

@petersli should be available from v4.12.1 !

@petersli
Copy link

petersli commented Jul 2, 2024

hi @damzobridge, I think this actually doesn't catch the errors thrown by file.init() due to it being async. I think this could fix it: #270

@damzobridge
Copy link
Contributor Author

Thanks @petersli , you're right! However, we're also working on updating the core rive-wasm package to catch all the RiveFile.init() issues and report them using the error callbacks. Once that's done we'll push out a fix for the react package.

@petersli
Copy link

hey @damzobridge, would you happen to have an eta on this? would help inform how I should plan around this issue -- for context, the update I want to make requires useRiveFile because we need to know when all assets (including rive.wasm) have loaded in. I can't use useRiveFile in it's current state because it would crash the app upon any RiveFile.init() issue.

If this fix is still a while out, I'll just roll my own version of the useRiveFile hook that fails gracefully.

@damzobridge
Copy link
Contributor Author

Hi @petersli I would recommend rolling your version in the meantime. Will let you know as soon as the updated rive.wasm version is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants