-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RNTester: Crash loading <Image> page #3738
Comments
This may be a dupe of #2452 |
Marlene thinks the image won't load because the test was just copied from Android and the image is only part of the Android bundle. |
This test assumes that the host app has some kind of native image/resource and that For our code, we automatically resolve the whole uri to
However, we don't have a proper RNTester app, we have Playground. So we could do either of the above to the Playground app, but it would a weird dependency for Playground. We should, however, not ever crash because of missing images. Is there a standard image not found image we could use? |
Ok, it looks like it's expected to be an unsafe operation, and there are different rules for iOS and Android: https://reactnative.dev/docs/images#images-from-hybrid-apps-resources We should update the logic in ImageViewManager::setSource() to properly handle all of the supported image uri types:
I think that's all of them, but we should test the different configs (debug, release, with/without bundles, with/without assets) |
For this particular bug, I think the right thing to do is not support a plain Potentially though we could add an example where we explicitly set an ms-appx:// uri and it should work. |
PR out to prevent crashing when trying to load invalid uris, just fail. |
The
page in RNTester is having issues and crashes when you try to load it.
Callstack to the crash:
Debug spew says:
Exception thrown at 0x764A35D2 (KernelBase.dll) in Playground.exe: WinRT originate error - 0x80070057 : 'legacy_image is not a valid absolute URI.'.
Exception thrown at 0x764A35D2 in Playground.exe: Microsoft C++ exception: winrt::hresult_invalid_argument at memory location 0x04AFC88C.
Exception thrown at 0x764A35D2 in Playground.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Debugging back to the property setter, we have this:
So, we have an
with a uri of "legacy_image" and that's failing to resolve to a valid resource in our appx package. It looks like we either aren't packaging image resources for RNTester properly, or aren't resolving the URI propertly.
The text was updated successfully, but these errors were encountered: