ssorallen / react-play

Render React components in the Play Framework with JDK8's JavaScript engine
MIT License
214 stars 26 forks source link

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

Closed paulwehner closed 7 years ago

paulwehner commented 9 years ago

http://stackoverflow.com/questions/29429955/error-rendering-react-js-using-jvm-nashorn-play-framework-i-get-null-is-not

ssorallen commented 9 years ago

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?

paulwehner commented 9 years ago

I just added that edit for console. Please let me know if you figure anything out. I realized that it was the

ssorallen commented 9 years ago

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")
      )
    );
  }
});
paulwehner commented 9 years ago

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

ssorallen commented 9 years ago

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.

ssorallen commented 7 years ago

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