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.

HTML Serializer is Incompatible with React-Native

See original GitHub issue

Do you want to request a feature or report a bug?

Feature

What’s the current behavior?

Trying to import the html-serializer into a react-native project causes the error:

document is not defined - I assume this occurs because the html-serializer relies on the built in DOMParser

The above is inaccurate and seems to be caused by my schema somehow, although I believe the issue itself is still relevant as React-Native is missing DOMParser as far as I can tell.

What’s the expected behavior?

It’s probably not reasonable to expect this to work out of the box, but it would be great to:

  1. Find a way to throw a friendlier error message thrown before React-Native can throw its own - Right now we have that, but React-Native beats it to the punch.
  2. Determine an alternative to DOMParser and jsdom that can be passed to the html-serializer

Potentially interesting avenues to explore:

@ianstormtaylor do you have any ideas that might be less cumbersome than the above?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brendancarneycommented, Mar 7, 2019

I had an issue with parse5 where node.nodeValue is null in parse5, but node.value isn’t:

https://github.com/ianstormtaylor/slate/blob/master/packages/slate-html-serializer/src/index.js#L47

I haven’t looked into what is right.

0reactions
ianstormtaylorcommented, Nov 28, 2019

As of https://github.com/ianstormtaylor/slate/pull/3093 (which was just merged), I believe this issue is no longer applicable, because a lot has changed. I’m going through and closing out any potential issues that are not out of date with the overhaul. Thanks for understanding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix the incompatible version problems in a React app?
I have a React application and I use Yarn to maintain packages. ... field "ansi-html@0.0.8" is incompatible with requested version ...
Read more >
react-native-parse-html - npm
Start using react-native-parse-html in your project by running `npm ... ready for production HTML parsing/serialization toolset for Node.js.
Read more >
react-native | Yarn - Package Manager
React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access...
Read more >
Configuration cache - Gradle User Manual
Gradle uses its own optimized serialization mechanism and format to store the configuration cache entries. It automatically serializes the state of ...
Read more >
Node.js v19.3.0 Documentation
html document has a corresponding .json document. This is for IDEs and other utilities that consume the documentation. System calls and man pages#....
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