ssorallen/react-play

Nashorn gives an error where client rendering doesn't. Do you know what is wrong? StackOverflow:

paulwehner opened this issue · 6 comments

I was able to reproduce this locally. I will do some testing and see if I can figure out what's going wrong.

I noticed your addition of console = ... to make console logging possible from inside Nashorn. Would you mind contributing that to the project?

I just added that edit for console. Please let me know if you figure anything out. I realized that it was the element that caused the error. If I removed that from the React render function, then it runs fine within Nashorn. Not sure why would cause React to stop working within Nashorn though.

I've narrowed this down to only a few React element instantiations, but I'm still unclear why this is a problem for Nashorn. Pasting this here in case anyone else tries it and figures out why it fails in Nashorn:

var App = React.createClass({
  render: function() {
    return (
      React.createElement("div", null,
        React.createElement("button"),
        React.createElement("input")
      )
    );
  }
});

Just tested it, and it works in 8u60 release. For some reason it breaks in the previous releases.

Thanks for checking the new release. Do you know when that will make it into a Java release?

If a new version of Nashorn solves this problem, I won't investigate any further and instead suggest people upgrade Java versions.

This was a bug in a specific version of Java. It's far outdated at this point, so I'm closing this.