remarkjs / remark-react

Legacy plugin to transform to React — please use `remark-rehype` and `rehype-react` instead
https://unifiedjs.com
MIT License
524 stars 37 forks source link

TypeError: No default value #24

Closed OKNoah closed 8 years ago

OKNoah commented 8 years ago

When using an earlier version, I was having the issue where < symbols would show up as &lt;. I updated to 3.0.1 but got issues there.

MIDDLEWARE ERROR:
Error: mdast-util-definitions expected node — index.js:53
["loginPage/USER_FETCH", "loginPage/USER_FETCH_SUCCESS", "loginPage/USER_FETCH_FAILURE"] 

I took this to be because remark was version 4.2.0so I updated that to 5.0.1. Now I get errors like this:

MIDDLEWARE ERROR:
TypeError: No default value — traverseAllChildren.js:157
["loginPage/USER_FETCH", "loginPage/USER_FETCH_SUCCESS", "loginPage/USER_FETCH_FAILURE"]
wooorm commented 8 years ago

Hi @OKNoah! What version of React are you using? I couldn’t find much, other than that it’s maybe input related?

OKNoah commented 8 years ago

@wooorm The updating stuff aside, I think there is a bug with < and > within backticks.

Here is the input and the output from the console.

screen shot 2016-07-27 at 4 14 37 pm screen shot 2016-07-27 at 4 14 17 pm

This is the issue (and commit) that I thought might resolve the problem, but I think I was mistaken about what version it was introduced in, which is why I was trying to update everything: https://github.com/mapbox/remark-react/issues/3

OKNoah commented 8 years ago

Looks like this is fixed in an update. After adding .contents after .process() everything seems to work. I don't see that in the README though.