Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

throw new TypeError(Unknown node of type: ${node.type}); #35

Closed
mhaagens opened this issue Feb 14, 2017 · 5 comments
Closed

throw new TypeError(Unknown node of type: ${node.type}); #35

mhaagens opened this issue Feb 14, 2017 · 5 comments
Labels

Comments

@mhaagens
Copy link

Probably me doing something wrong, but I'm getting this error now;

/Users/user/project/node_modules/rapscallion/src/render/traverse.js:212

throw new TypeError(`Unknown node of type: ${node.type}`);TypeError: Unknown node of type: undefined
@aweary
Copy link
Contributor

aweary commented Feb 14, 2017

@mhaagens thanks for the report! Can you share the component you're trying to render when you get that error, or preferably a simplified example if it's part of a large render tree?

@divmain divmain added the bug label Feb 14, 2017
@divmain
Copy link
Contributor

divmain commented Feb 14, 2017

@mhaagens, if you're able to come up with a minimal reproduction, can you update the repo we were working from earlier? You should still have push rights.

@mhaagens
Copy link
Author

Sure, not able to right now but I can get on it tomorrow.

divmain added a commit that referenced this issue Feb 15, 2017
@divmain
Copy link
Contributor

divmain commented Feb 15, 2017

@mhaagens, this may have been related to children elements that are arrays. I've pushed a fix and published v2.0.1. Let me know if that resolves the issue for you, and I'll close this out.

const Foo = () => (
  <div>
    <h1 id="foobar">Hello, world</h1>
  </div>
);

const Bar = () => (
  <div>
    <div id="sibling" />
    {
      range(5).map(idx =>
        <Foo key={idx} />
      )
    }
  </div>
);

@mhaagens
Copy link
Author

Yep, that fixed it, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants