Typeerror first argument must be a string html-react-parser
There are several problems in the code.
In summary, the correct code would look like:
Traceback:
I am a JS beginner, so apologies if there is an easy fix for this. I have a Preact project that I'm trying to render markdown on, and I'm passing a string in according to the documentation. I've performed the preact-compat redirect and other react packages are working as expected. Here is example code:
I have also tried I was creating an npm module with the help create-react-library,
Welcome to the Treehouse CommunityThe Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.) Looking to learn something new?Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
2 AnswersChristian Higgins June 7, 2018 7:32pm James, I was having the same problem because I had stopped watching the video too soon. Andrew also has an error in the video starting about 4:15. I'm seeing that you're missing the that he ends up adding in. Jonathan McWilliams September 19, 2018 7:15pm I had that error when I did not have this line of code correct in the renderer.js, I think I had just readFile instead of readFileSync var fileContents = fs.readFileSync('./views/' + templateName + '.html');
|