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

Rails 6 Webpack and no sprockets #160

Open
xkraty opened this issue Nov 11, 2020 · 3 comments
Open

Rails 6 Webpack and no sprockets #160

xkraty opened this issue Nov 11, 2020 · 3 comments

Comments

@xkraty
Copy link

xkraty commented Nov 11, 2020

Hello,

in my app setup I am using only webpacker and rake tolk:setup clearly doesn't work due to the asset pipeline absence, any suggestion on how to make it work with webpacker ?

Thanks
Chris

@thomasdarde
Copy link
Member

Hello @xkraty , I do have an app relying only on webpacker and it workds fine.
I think your issue is somewhere else not linked to talk ?

I've just tried tolk:setup and it runs fine on this app (but it's just a shortcut to add some routes and a migration that you can copy from the source code

@xkraty
Copy link
Author

xkraty commented Nov 12, 2020

Hello @thomasdarde,

thanks for your answer, in our setup the old sprockets is disabled since we do rely on webpack for everything, including images.

In the application.rb we have disabled unused frameworks as sprockets.

require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
# require "action_mailbox/engine"
# require "action_text/engine"
require "action_view/railtie"
require "action_cable/engine"
# require "sprockets/railtie"
# require "rails/test_unit/railtie"

I'm guessing best solution here is just to re-enable sprockets and let the gem work as it's designed.

Thanks
Chris

@xkraty xkraty changed the title Rails 6 Webpack and no assets pipeline Rails 6 Webpack and no sprockets Nov 12, 2020
@gingerlime
Copy link

gingerlime commented Apr 10, 2021

I tried it with our rails 6 app which we removed the asset pipeline for, and I'm getting this error after running rake tolk:setup

NoMethodError: undefined method `assets' for #<Rails::Application::Configuration:0x000055d82314ef50>

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

3 participants