question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linked image fails at render

See original GitHub issue

I swear that I have completed these tasks before submitting:

Decision table

  • My issue does not look like “The HTML attribute ‘xxx’ is ignored” (unless we claim support for it),
  • My issue does not look like “The HTML element <yyy> is not rendered”

Bug Report

GenericPressable error comes when I try to render a linked image.

  Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `GenericPressable`.

This error is located at:
    in GenericPressable (created by TDefaultBlockRenderer)
    in TDefaultBlockRenderer (created by AElement)
    in AElement (created by ARenderer)
    in ARenderer (created by TBlockRenderer)
    in TBlockRenderer (created by TNodeRenderer)
    in TNodeRenderer (created by TChildrenRenderer)
    in TChildrenRenderer (created by TNodeChildrenRenderer)
    in TNodeChildrenRenderer (created by TNodeChildrenRenderer)
    in TNodeChildrenRenderer (at TBlockRenderer.tsx:21)
    in RCTView (created by TDefaultBlockRenderer)
    in TDefaultBlockRenderer (created by TBlockRenderer)
    in TBlockRenderer (created by TNodeRenderer)
    in TNodeRenderer (created by TChildrenRenderer)
    in TChildrenRenderer (created by TNodeChildrenRenderer)
    in TNodeChildrenRenderer (created by TNodeChildrenRenderer)
    in TNodeChildrenRenderer (at TBlockRenderer.tsx:21)
    in RCTView (created by TDefaultBlockRenderer)
    in TDefaultBlockRenderer (created by TBlockRenderer)
    in TBlockRenderer (created by TNodeRenderer)
    in TNodeRenderer (created by TChildrenRenderer)
    in TChildrenRenderer (created by TNodeChildrenRenderer)
    in TNodeChildrenRenderer (created by TNodeChildrenRenderer)
    in TNodeChildrenRenderer (at TDocumentRenderer.tsx:52)
    in Unknown (at RenderResolvedHTML.tsx:9)
    in RenderResolvedHTML (at RenderHTMLFragment.tsx:89)
    in InlineSourceLoader (created by SourceLoader)
    in SourceLoader (created by RenderHTMLFragment)
    in SharedPropsProvider (at RenderHTMLFragment.tsx:99)
    in RenderHTMLDebug (at RenderHTMLFragment.tsx:98)
    in RenderHTMLFragment (created by RenderHTML)
    in RenderRegistryProvider (at TRenderEngineProvider.tsx:96)
    in TRenderEngineProvider (at RenderHTML.tsx:23)
    in RenderHTML (at TicketDescription.tsx:37)
    in RCTView (at TicketDescription.tsx:31)
    in TicketDescription (created by inject-with-ticketStore(TicketDescription))
    in inject-with-ticketStore(TicketDescription) (at TicketScreen.tsx:180)
    in RCTView (at ShadowComponent.tsx:25)
    in ShadowComponent (at TicketScreen.tsx:170)
    in RCTScrollContentView (at ScrollView.js:1038)
    in RCTScrollView (at ScrollView.js:1178)
    in ScrollView (at TicketScreen.tsx:164)
    in TicketScreen (created by inject-with-transferStore-ticketStore(TicketScreen))
    in inject-with-transferStore-ticketStore(TicketScreen) (created by withProps(inject-with-transferStore-ticketStore(TicketScreen)))
    in withProps(inject-with-transferStore-ticketStore(TicketScreen)) (at SceneView.tsx:122)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:115)
    in EnsureSingleNavigator (at SceneView.tsx:114)
    in SceneView (at useDescriptors.tsx:150)
    in RCTView (at CardContainer.tsx:221)
    in RCTView (at CardContainer.tsx:220)
    in RCTView (at CardSheet.tsx:33)
    in ForwardRef(CardSheet) (at Card.tsx:563)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at Card.tsx:545)
    in PanGestureHandler (at GestureHandlerNative.tsx:13)
    in PanGestureHandler (at Card.tsx:539)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at Card.tsx:535)
    in RCTView (at Card.tsx:529)
    in Card (at CardContainer.tsx:189)
    in CardContainer (at CardStack.tsx:558)
    in RCTView (at Screens.tsx:69)
    in MaybeScreen (at CardStack.tsx:551)
    in RCTView (at Screens.tsx:48)
    in MaybeScreenContainer (at CardStack.tsx:461)
    in CardStack (at StackView.tsx:458)
    in KeyboardManager (at StackView.tsx:456)
    in SafeAreaProviderCompat (at StackView.tsx:453)
    in RCTView (at StackView.tsx:452)
    in StackView (at createStackNavigator.tsx:85)
    in StackNavigator (at TicketStack.tsx:28)
    in TicketStack (at SceneView.tsx:122)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:115)
    in EnsureSingleNavigator (at SceneView.tsx:114)
    in SceneView (at useDescriptors.tsx:150)
    in RCTView (at BottomTabView.tsx:41)
    in SceneContent (at BottomTabView.tsx:117)
    in RCTView (at ResourceSavingScene.tsx:43)
    in RCTView (at ResourceSavingScene.tsx:26)
    in ResourceSavingScene (at BottomTabView.tsx:112)
    in RCTView (at src/index.native.js:134)
    in ScreenContainer (at BottomTabView.tsx:96)
    in RCTView (at BottomTabView.tsx:95)
    in SafeAreaProviderCompat (at BottomTabView.tsx:94)
    in BottomTabView (at createBottomTabNavigator.tsx:41)
    in BottomTabNavigator (at TabNavigator.tsx:51)
    in MainNavigator (at SceneView.tsx:122)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:115)
    in EnsureSingleNavigator (at SceneView.tsx:114)
    in SceneView (at useDescriptors.tsx:150)
    in RCTView (at CardContainer.tsx:221)
    in RCTView (at CardContainer.tsx:220)
    in RCTView (at CardSheet.tsx:33)
    in ForwardRef(CardSheet) (at Card.tsx:563)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at Card.tsx:545)
    in PanGestureHandler (at GestureHandlerNative.tsx:13)
    in PanGestureHandler (at Card.tsx:539)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at Card.tsx:535)
    in RCTView (at Card.tsx:529)
    in Card (at CardContainer.tsx:189)
    in CardContainer (at CardStack.tsx:558)
    in RCTView (at Screens.tsx:69)
    in MaybeScreen (at CardStack.tsx:551)
    in RCTView (at Screens.tsx:48)
    in MaybeScreenContainer (at CardStack.tsx:461)
    in CardStack (at StackView.tsx:458)
    in KeyboardManager (at StackView.tsx:456)
    in RNCSafeAreaProvider (at SafeAreaContext.tsx:74)
    in SafeAreaProvider (at SafeAreaProviderCompat.tsx:42)
    in SafeAreaProviderCompat (at StackView.tsx:453)
    in RCTView (at StackView.tsx:452)
    in StackView (at createStackNavigator.tsx:85)
    in StackNavigator (at AppNavigator.tsx:92)
    in EnsureSingleNavigator (at BaseNavigationContainer.tsx:390)
    in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:91)
    in ThemeProvider (at NavigationContainer.tsx:90)
    in ForwardRef(NavigationContainer) (at AppNavigator.tsx:77)
    in AppNavigator (at App.tsx:22)
    in MobXProvider (at App.tsx:19)
    in App (at renderApplication.js:40)
    in RCTView (at AppContainer.js:101)
    in RCTView (at AppContainer.js:119)
    in AppContainer (at renderApplication.js:39)

renderRoot
    [native code]:0
runRootCallback
    [native code]:0
callFunctionReturnFlushedQueue
    [native code]:0

Setup

React Native
System:
    OS: macOS 11.2.3
    CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
    Memory: 390.91 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.15.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.13.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5 
  npmGlobalPackages:
    react-native: 0.60.5
Libraries
  • react-native-render-html: 6.0.0-alpha.21
  • react-native-webview: 7.0.1

Devices

  • Device
    • OS: iOS 14.3
    • Diagnostic: reproduction
    • Environment: production / development

Reproduction

    <HTML
        source={{
          html: '<p><a href="https://google.com"><img src="http://www.hello.com/img_/hellowithwaves.png" alt="" /></a></p>',
        }}
        onLinkPress={(_event, url) => { Linking.openURL(url); }}
      />

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
jsamrcommented, Mar 30, 2021

@thekalko Thank you 😃 You can always start a little sponsorship if you will 😃. As per the margin issue, I believe it’s a bug; would love a repro in a separate ticket!

0reactions
thekalkocommented, Mar 30, 2021

@jsamr It works well, thank you! I don’t know how can I thank you, but if I can do anything, let me know.

I also found one thing: HTML styles negative margins could not be transferred to native ViewStyles, I created a render to test is, and I realised that, the positive margins are included into the render provided styles, but the negatives not. In case of If I add a negative margins at render it works well, so I solved it for myself but I don’t know if it’s a bug, but if it is, I can create you an issue to help solving it in foundry release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Linked image cannot be displayed error - Outlook
This issue occurs when the BlockHTTPimages registry value is set to 1 and the images in the email message have a source that...
Read more >
Direct Link Rendered Image does nothing and times out in ...
Issue: The "Direct Link Rendered Image" function times out regardless setting a timeout value. ... Tried using the direct API call via CURL,...
Read more >
rsvg doesn't render linked images - Stack Overflow
the image doesn't show up in the final file (the rest of the svg renders just fine). The relative path is correct based...
Read more >
Direct link rendered image - "failed to render an image"
When I use the 'Direct link rendered image' link, I get a 404. In the logs I only see this: t=2018-02-08T22:51:01+0000 lvl=info msg=Rendering...
Read more >
Image link in document fails to render - Obsidian Forum
Image link in document fails to render ... The link below is defined in mydocument.md, but it does not show up.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found