JSX files not compiled in development mode
After installing the gem (0.12.0.0), I am able to precompile my jsx files, but they are not compiled when I visit a page that requests a jsx file via javascript_include_tag. Should the JSX files be compiling on the fly in development mode?
Thanks!
They should compile on the fly. Did you add .jsx to the filename? For example, my_component.js.jsx.
Yes, the file is named member_list.js.jsx
In my view I have the following:
<%= javascript_include_tag('react') %>
<%= javascript_include_tag('react_components/member_list') %>
And at the top of my JSX file is
/** @jsx React.DOM */
I'm getting a console error: GET http://localhost:3000/assets/react_components/member_list.js 404 (Not Found)
When I update the js include tag to:
<%= javascript_include_tag('react_components/member_list.js.jsx') %>
I get this console error: Uncaught SyntaxError: Unexpected token < (because it isn't compiled)
That's nuts ... and you did restart your development server since installing the gem?
Yeah, just did once more to verify, but no change.
I got it working! I think it was some combination of a caching issue and JS load order... super weird, though. I'll reply here if I can unearth more details.
Thanks for the help!
I had the same issue. Components were not precompiled. I had to stop rails, delete the tmp folder, and restart.