Giter VIP home page Giter VIP logo

Comments (12)

jsamr avatar jsamr commented on July 20, 2024 2

@sonytooo please try npm install [email protected] and tell me if the bug persists.

from plugins.

jsamr avatar jsamr commented on July 20, 2024

@sonytooo The injected script is here: src/HTMLTable/script.ts. Indeed, there is no return type used.

Can you provide a minimal reproduction? Are you using WKWebView or UIWebView?

from plugins.

jsamr avatar jsamr commented on July 20, 2024

@sonytooo I see two related issues from react-native-webview:

They suggest executing code in a closure. I'll add a patch, and you'll be able to test and tell me if the error remains.

from plugins.

jsamr avatar jsamr commented on July 20, 2024

@sonytooo any news?

from plugins.

janrop avatar janrop commented on July 20, 2024

After upgrading to 0.4.0-rc.1 the issue seems to persist.

Error evaluating injectedJavaScript: This is possibly due to an unsupported return type. Try adding true to the end of your injectedJavaScript string.

__45-[ABI33_0_0RNCWKWebView evaluateJS:thenCall:]_block_invoke
    ABI33_0_0RNCWKWebView.m:767
WTF::Function<void (API::SerializedScriptValue*, bool, WebCore::ExceptionDetails const&, WebKit::CallbackBase::Error)>::CallableWrapper<-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]::$_0>::call(API::SerializedScriptValue*, bool, WebCore::ExceptionDetails const&, WebKit::CallbackBase::Error)
WebKit::GenericCallback<API::SerializedScriptValue*, bool, WebCore::ExceptionDetails const&>::performCallbackWithReturnValue(API::SerializedScriptValue*, bool, WebCore::ExceptionDetails const&)
WebKit::WebPageProxy::scriptValueCallback(IPC::DataReference const&, bool, WebCore::ExceptionDetails const&, WebKit::CallbackID)
WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&)
WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)
IPC::Connection::dispatchIncomingMessages()
WTF::RunLoop::performWork()
WTF::RunLoop::performWork(void*)
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
__CFRunLoopDoSources0
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
main
start

I tried clearing my packager cache and I am using the Minimal working example

from plugins.

superKalo avatar superKalo commented on July 20, 2024

@jsamr thank you for a fix in v0.4.0-rc.1! I confirm, problem is resolved on our end with this version! :)

PS: My colleague @sonytooo says thanks too! Sorry that he couldn't reply to you earlier.

from plugins.

janrop avatar janrop commented on July 20, 2024

@jsamr thank you for a fix in v0.4.0-rc.1! I confirm, problem is resolved on our end with this version! :)

PS: My colleague @sonytooo says thanks too! Sorry that he couldn't reply to you earlier.

Could you tell me your other dependencies versions?
I am still experiencing the issue on:

expo: "^33.0.0"
react-native-render-html": "^4.1.2"
react-native-render-html-table-bridge": "^0.4.0-rc.2"
react-native-snap-carousel": "^3.6.0"
react-native-webview": "^5.8.1"

from plugins.

superKalo avatar superKalo commented on July 20, 2024

Could you tell me your other dependencies versions?
I am still experiencing the issue on:

expo: "^33.0.0"
react-native-render-html": "^4.1.2"
react-native-render-html-table-bridge": "^0.4.0-rc.2"
react-native-snap-carousel": "^3.6.0"
react-native-webview": "^5.8.1"

Same for everything, except we don'h have react-native-snap-carousel and we are using react-native-webview at v5.12.1. Try to update it maybe?

One more thing is that we're using fixed versions of these libs. Maybe this helps:

"expo": "33.0.0",
"react-native-render-html": "4.1.2",
"react-native-render-html-table-bridge": "0.4.0-rc.1",
"react-native-webview": "5.12.1",

I assume you know, but make sure you start your project with expo r -c, so that the old version is not cached by some chance.

from plugins.

janrop avatar janrop commented on July 20, 2024

Unfortunately I am still getting the same error, even after using the exact same dependencies.

This ist my components displaying the html:

import React, {PureComponent} from 'react';
import { View, Text } from 'react-native';
import HTML from 'react-native-render-html';
import { IGNORED_TAGS, alterNode, makeTableRenderer } from 'react-native-render-html-table-bridge';
import WebView from 'react-native-webview';
import styles from '../constants/Styles';
import Colors from '../constants/Colors';

const config = {
    WebViewComponent: WebView
};

const renderers = {
  table: makeTableRenderer(config)
};

const htmlConfig = {
  alterNode,
  renderers,
  ignoredTags: IGNORED_TAGS,
  tagsStyles: styles.htmlStyles,
  listsPrefixesRenderers: {
    ol: (htmlAttribs, children, convertedCSSStyles, passProps) => {
      return (
        <Text allowFontScaling={passProps.allowFontScaling} style={{
          marginRight: 5,
          marginTop: 1,
          fontSize: 14,
          color: Colors.app.text
        }}>{ passProps.index + 1 })</Text>
      )
    },
    ul: (htmlAttribs, children, convertedCSSStyles, passProps) => {
      return (
        <View style={{
          marginRight: 10,
          width: 14 / 2.8,
          height: 14 / 2.8,
          marginTop: 14 / 2 + 1,
          borderRadius: 14 / 2.8,
          backgroundColor: Colors.app.text
        }} />
      );
    }
  }
};

export default class Html extends PureComponent {
  render() {
    const { html } = this.props;
    console.log(html);
    return (
      <HTML html={html} {...htmlConfig}/>
    )
  }
}

And this is the html I am trying to render:

<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>data</td>
<td>path to data files to supply the data that will be passed into templates.</td>
</tr>
<tr>
<td>engine</td>
<td>engine to be used for processing templates. Handlebars is the default.</td>
</tr>
<tr>
<td>ext</td>
<td>extension to be used for dest files.</td>
</tr>
</tbody>
</table>

Is there any more Information I can provide for debugging?

from plugins.

jsamr avatar jsamr commented on July 20, 2024

@janrop @superKalo Perhaps the bug is orthogonal to the dependency tree, and instead related to the iOS version of the terminal device you tested. Could you please provide a list of terminals you tested, and the output of those tests?

from plugins.

janrop avatar janrop commented on July 20, 2024

How do describe a terminal? After your comment I tried running it on devices and it seems to work there. Only the Simulator still shows the error message.

from plugins.

jsamr avatar jsamr commented on July 20, 2024

@janrop That's a confusion of words of my own! In french « terminal » stands for « device »; I just mixed the two languages ^^

from plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.