Skip to content
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

It seems that I cannot pre-render with components of material ui #193

Closed
imWildCat opened this issue Mar 3, 2015 · 3 comments
Closed

It seems that I cannot pre-render with components of material ui #193

imWildCat opened this issue Mar 3, 2015 · 3 comments

Comments

@imWildCat
Copy link

// in assets/javascripts/components/_list_box.js.jx : 
var mui = require('material-ui');

var Paper = mui.Paper;

var ListBox = React.createClass({
    render: function () {
        return (
            <Paper zDepth={1} />
        )
    }
});

If I render in my view <%= react_component 'TopMenu', {}, {prerender: true} %>, an error occurred, saying it was not defined.

assets/javascripts/components.js :

//= require_tree ./components

Gems I used:

gem 'therubyracer', platforms: :ruby

gem 'browserify-rails', '~> 0.7.4'
# Server-rendering isn't in 0.x, need to grab the 1.x prerelease
gem 'react-rails', '~> 1.0.0.pre', github: 'reactjs/react-rails'
@rmosolgo
Copy link
Member

rmosolgo commented Mar 3, 2015

I think this is because prerender currently doesn't support commonjs-style require :(

You can find a discussion of that issue & some workarounds here: #129 (comment)

@imWildCat
Copy link
Author

@rmosolgo Thanks for your reply : )

@rmosolgo
Copy link
Member

rmosolgo commented Mar 4, 2015

👍 hope it helps, feel free to reopen if it turns out to be something else!

@rmosolgo rmosolgo closed this as completed Mar 4, 2015
@imWildCat imWildCat changed the title It seems than I cannot pre-render with components of material ui It seems that I cannot pre-render with components of material ui Mar 4, 2015
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

2 participants