-
Notifications
You must be signed in to change notification settings - Fork 753
Closed
Description
While investigating #57 I came across a bug which might be the cause for many of the problems people are experiencing while trying out server-side rendering:
The components.js
file is cached, even in development mode!
That means changes are not picked up until the rails server is restartet, hich causes confusing errors like [React::Renderer] ReferenceError: MyComponent is not defined
even when it clearly is included.
To reproduce:
-
app/assets/javascripts/components.js
:/** @jsx React.DOM */ var DummyComponent = React.createClass({displayName: 'DummyComponent', render: function () { return ( React.DOM.div(null, this.props.text ) ); } });
-
Put this in any view:
=react_component('DummyComponent', {:text => 'Hello'}, {:prerender => true})
-
bundle exec rails s
-
load the page corresponding to the view from 2..
-
add the following anywhere in
app/assets/javascripts/components.js
;throw "WTF"
-
reload page – it does not throw
-
restart server and reload page – does throw
Metadata
Metadata
Assignees
Labels
No labels