roman01la / html-to-react-components

Converts HTML pages into React components
https://roman01la.github.io/html-to-react-components/
MIT License
2.13k stars 136 forks source link

Plugin error #17

Closed hecomp closed 6 years ago

hecomp commented 6 years ago

Hi,

I'm facing this issue when running against my index.html

'''/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:4457 throw err; ^

SyntaxError: Unexpected token (21:59) at Parser.pp$5.raise (/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:4454:13) at Parser.pp.unexpected (/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:1761:8) at Parser.pp$9.jsxParseIdentifier (/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:7029:10) at Parser.pp$9.jsxParseNamespacedName (/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:7040:19) at Parser.pp$9.jsxParseAttribute (/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:7135:20) at Parser.pp$9.jsxParseOpeningElementAt (/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:7147:31) at Parser.pp$9.jsxParseElementAt (/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:7169:29) at Parser.pp$9.jsxParseElementAt (/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:7182:30) at Parser.pp$9.jsxParseElementAt (/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:7182:30) at Parser.pp$9.jsxParseElementAt (/usr/local/lib/node_modules/html-to-react-components/node_modules/babylon/lib/index.js:7182:30)'''

roman01la commented 6 years ago

Hi. Happy to help. Please, provide a repro. Maybe that html file?

hecomp commented 6 years ago

I didn't put on a repo yet but here it is.

`<!DOCTYPE html>

Friend Finder | A Complete Social Network Template

Make Cool Friends !!!

Friend Finder is a social network template that can be used to connect people. The template offers Landing pages, News Feed, Image/Video Feed, Chat Box, Timeline and lot more.

Why are you waiting for? Buy it now.

Register Now !!!

Be cool and join today. Meet millions

Date of Birth

Already have an account?

Login

Log into your account

Forgot Password?

`

roman01la commented 6 years ago

There's an invalid syntax in your HTML, missed = character

<div class="tab-content" data-component"TabContent">

Once fixed, it works as expected

hecomp commented 6 years ago

Hi @roman01la that was my bad. But love the tool, it saved me a lot of time!!!! Great work!!!!! Thanks for the help!!!

roman01la commented 6 years ago

You are welcome :)