-
Notifications
You must be signed in to change notification settings - Fork 759
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
javascript_dir': undefined method
source_path' for Webpacker::Configuration:Class (NoMethodError)
#778
Comments
javascript_dir': undefined method
source_path' for Webpacker::Configur0ation:Class (NoMethodError)javascript_dir': undefined method
source_path' for Webpacker::Configuration:Class (NoMethodError)
The fix you suggested worked for me. |
Going to close this issue, as this has been fixed with #777 . Thanks @BookOfGreg, for your great work to pass this on master. If you guys get any issues, please feel free to re-open this. |
This also has to be changed in
to to run
or you'll get something like
|
I'm still having this issue and was wondering if the latest merge fixed it or if there is a workaround on my end that I can do before a fix is released, thanks for all the work you do! |
I tried the following steps to reproduce but was OK. rbenv shell 2.4.1
gem install rails
rails new foo --webpack
cd foo
echo "gem 'react-rails', git: 'https://github.com/reactjs/react-rails.git', branch: 'master'" >> Gemfile
bundle
rails g react:install
rails g react:component page name:string Can you check if it's fixed by installing the master branch?
|
Had the same issue, the current master branch fixed it. |
reactjs/react-rails#778 (comment) rails g react:install
This one is working with my issue! |
I am trying to install 'react-rails' with 'webpacker'. I added both this gems in my rails gemfile. Versions for ruby, rails & gems are as follows:-
I am not able to run "rails generate react:install" command to generate components/ directory for my React components.
I found that there was an issue in "react-rails-2.2.1/lib/generators/react/install_generator.rb" file for javascript_dir method.
Earlier code:-
def javascript_dir
if webpacker?
Webpacker::Configuration.source_path
.join(Webpacker::Configuration.entry_path)
.relative_path_from(::Rails.root)
.to_s
else
'app/assets/javascripts'
end
end
Code to fix:
def javascript_dir
if webpacker?
Webpacker.config.source_path
.join(Webpacker.config.source_entry_path)
.relative_path_from(::Rails.root)
.to_s
else
'app/assets/javascripts'
end
end
The term
Webpacker::Configuration
is chnaged toWebpacker.config
and method nameentry_path
is changed tosource_entry_path
.This work for me..!! Hope this works for you guys!
The text was updated successfully, but these errors were encountered: