-
Notifications
You must be signed in to change notification settings - Fork 754
Require files with browserify #311
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
Comments
when do you get that error? |
I get it when I load index.html.erb where I'm including this React component. |
Is To add Map to the global scope, assign If that doesn't help please share:
|
The |
What is the recommended way to require external libraries with |
see some existing issues for discussion of |
So I should move the folders from |
@adoseofjess I think it is the way you require and not about the file location. Try something like: instead of:
|
In addition to what others said, you need to add In application.rb, add
Restart the rails server. Now you can do something like
|
@adoseofjess I've created a very basic demo repo showing server side rendering with browserify-rails and react-rails. After some fighting against sprockets, the configuration supports the In my own project, I've modified |
thanks @Fletcher91 exactly what I was looking for to get started using imports browserify and react with rails |
@adoseofjess You can use this gem webpackrails, and here is an example on how to use it webpackrails-example. It works with |
@Fletcher91 you are amazing, thank you soooo much for your help! I used your test app to construct my own integration of material-ui with a Rails project. I'm sure I did some things wrong here, but if it helps anyone else, please feel more than free to borrow from my repo. |
Thanks for sharing some solutions here! I'll keep an eye out for forthcoming Rails 5.1 asset changes too, and see if there's anything react-rails can take advantage of. |
I have a React component and added browserify-rails gem to require files.
And I get this error:
Uncaught TypeError: undefined is not a function
The text was updated successfully, but these errors were encountered: