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

Unterminated JSX contents #50

Closed r0m4 closed 3 years ago

r0m4 commented 3 years ago

I have tried to convert html to React, but received such an error

Romans-MacBook-Pro:test r0m4$ sudo html2react index.html /usr/local/lib/node_modules/html-to-react-components/node_modules/prettier/index.js:9750 throw error; ^

SyntaxError: Unterminated JSX contents (1158:11) 1156 |

1157 |

1158 |

; | ^ 1159 | } 1160 | 1161 | } at e (/usr/local/lib/node_modules/html-to-react-components/node_modules/prettier/parser-babylon.js:1:282) at Object.parse (/usr/local/lib/node_modules/html-to-react-components/node_modules/prettier/parser-babylon.js:1:262260) at Object.parse (/usr/local/lib/node_modules/html-to-react-components/node_modules/prettier/index.js:9739:19) at coreFormat (/usr/local/lib/node_modules/html-to-react-components/node_modules/prettier/index.js:13252:23) at format (/usr/local/lib/node_modules/html-to-react-components/node_modules/prettier/index.js:13510:73) at formatWithCursor (/usr/local/lib/node_modules/html-to-react-components/node_modules/prettier/index.js:13526:12) at /usr/local/lib/node_modules/html-to-react-components/node_modules/prettier/index.js:44207:15 at Object.format (/usr/local/lib/node_modules/html-to-react-components/node_modules/prettier/index.js:44226:12) at /usr/local/lib/node_modules/html-to-react-components/lib/format.js:5:27 at Array.reduce () { loc: { start: { line: 1158, column: 11 } }, codeFrame: '\x1B[0m \x1B[90m 1156 | \x1B[39m \x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mdiv\x1B[39m\x1B[33m>\x1B[39m\x1B[0m\n' + '\x1B[0m \x1B[90m 1157 | \x1B[39m \x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mfooter\x1B[39m\x1B[33m>\x1B[39m\x1B[0m\n' + '\x1B[0m\x1B[31m\x1B[1m>\x1B[22m\x1B[39m\x1B[90m 1158 | \x1B[39m \x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mdiv\x1B[39m\x1B[33m>\x1B[39m\x1B[33m;\x1B[39m\x1B[0m\n' + '\x1B[0m \x1B[90m | \x1B[39m \x1B[31m\x1B[1m^\x1B[22m\x1B[39m\x1B[0m\n' + '\x1B[0m \x1B[90m 1159 | \x1B[39m }\x1B[0m\n' + '\x1B[0m \x1B[90m 1160 | \x1B[39m\x1B[0m\n' + '\x1B[0m \x1B[90m 1161 | \x1B[39m}\x1B[0m' }

here is the HTML that I tried to convert: https://drive.google.com/file/d/1JYDMWeFsBl1bJU0Oz8UtlOBBYOjuSepI/view?usp=sharing

roman01la commented 3 years ago

I'd suggest to pass only actual HTML in the <body> tag and if the issue still exists try to remove HTML content tag by tag to identify where the problem is.

r0m4 commented 3 years ago

Все получилось, српасибо тебе большое друг, ты сильно помог своей работой. Great convertor, i recommend!