Skip to content

ReferenceError: ReactDOMServer is not defined #470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bhernez opened this issue Feb 8, 2016 · 5 comments
Closed

ReferenceError: ReactDOMServer is not defined #470

bhernez opened this issue Feb 8, 2016 · 5 comments

Comments

@bhernez
Copy link

bhernez commented Feb 8, 2016

Hi,

I'm kind of new using this gem, I'm starting a Rails 4.2.5 project and when I declare a component inside a .html.erb view and add the option {prerender: true} it always throws this error:

Encountered error "ReferenceError: ReactDOMServer is not defined" when prerendering COMPONENT_NAME

I'm unsure how related is this issue with this one: #443 but trying the suggested patch stops the error, but I adds another js file in the client (I don't think it is good for performance)

According to this StackOverflow post, I'm not the only one with this issue http://stackoverflow.com/questions/35200728/react-rails-component-with-prerender-true-issue

Thanks!

@rmosolgo
Copy link
Member

rmosolgo commented Feb 8, 2016

What's the sprockets version and sprockets-rails version in your gemfile.lock? (I think this happens for any sprockets 3 user)

@bhernez
Copy link
Author

bhernez commented Feb 8, 2016

@rmosolgo You are rigth about the version, I have sprockets 3.5.2 and sprockets-rails 3.0.1

@davidmilo
Copy link

Any solution for this other than downgrading sprockets? Browserify-rails is unfortunately dependant on sprockets > 3.0

@rmosolgo
Copy link
Member

rmosolgo commented Feb 9, 2016

Here's a workaround: #443 (comment)
Here's a fix (with breaking changes): #471

@bhernez
Copy link
Author

bhernez commented Feb 9, 2016

I'll try the fix too, I guess this is closed for now. Thanks!

@bhernez bhernez closed this as completed Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants