conorhastings / react-native-syntax-highlighter

a syntax highlighter for react native using https://github.com/conorhastings/react-syntax-highlighter under the hood
MIT License
168 stars 24 forks source link

Console errors in React Native Debug mode #12

Closed ahetawal-p closed 1 year ago

ahetawal-p commented 6 years ago

Hi @conorhastings, Apologies for filing multiple issues. As I am really looking forward to integrate this highlighter in my current app.
I am using below versions in my

"react-native-syntax-highlighter": "^2.0.0",
"react-syntax-highlighter": "^7.0.1",

But when running my app under React Native debug mode, the console log is getting flooded with below message

VM651:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at prism-core.js:493

Although the highlighter view loads fine, but the console log seems to be bogged down with the error messages. Would be great if this can be fixed.

Thank you again,

conorhastings commented 6 years ago

@ahetawal-p do you have a code sample?

ahetawal-p commented 6 years ago

Nothing specific, I just tried using the syntax-highlighter in one of my views

<SyntaxHighlighter
     language='java'
     style={dracula}
  >
  {codeString}
  </SyntaxHighlighter>

And in debug mode I start seeing flood of above error messages on chrome console.

Seems something related to the prism-core.js as soon as it gets imported in my app through highlighter, the console starts showing the messages

PS: Its seems to related this issue: https://github.com/PrismJS/prism/issues/1303

andrey-skl commented 6 years ago

Have the same issue, it really doesn't let me debugging things

conorhastings commented 6 years ago

I know it's been a while, i've been busy with a move / new job / but it's on my todo list for this weekend, thanks for the patience.

mehulmpt commented 6 years ago

Still the same. Any update on this?

KonstantinZhukovskij commented 1 year ago

any news here?

chaitanya71998 commented 9 months ago

any update on this issue? @chrisglein

chrisglein commented 8 months ago

any update on this issue? @chrisglein

Fix has been merged. There hasn't been a NPM release that includes it yet.

chaitanya71998 commented 8 months ago

Thanks @chrisglein , can i know how to use package in this case without clonning?

chaitanya71998 commented 8 months ago

@chrisglein ?