Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

Detect if app is using Webpacker, then skip stimulus:install #2

Closed
dhh opened this issue Dec 23, 2020 · 4 comments
Closed

Detect if app is using Webpacker, then skip stimulus:install #2

dhh opened this issue Dec 23, 2020 · 4 comments

Comments

@dhh
Copy link
Member

dhh commented Dec 23, 2020

hotwire-rails installs stimulus-rails, which was designed exclusively for use with the asset pipeline. It doesn't make sense to run stimulus:install, if the app is using Webpacker. So detect and skip that.

(This essentially means that if you're not using the asset pipeline, you can just use the turbo-rails gem directly. But I could see people following tutorials and missing this part.)

@dhh
Copy link
Member Author

dhh commented Dec 28, 2020

Actually, even better, we should upgrade stimulus-rails to have a stimulus:install task that adds stimulus to package.json if it isn't already. Ala webpack:install:stimulus. Going to do that instead.

@dhh dhh closed this as completed Dec 28, 2020
@mjgiarlo
Copy link

mjgiarlo commented Jan 15, 2021

@dhh 💬

Actually, even better, we should upgrade stimulus-rails to have a stimulus:install task that adds stimulus to package.json if it isn't already. Ala webpack:install:stimulus. Going to do that instead.

Is there an issue I might subscribe to for tracking this? Thanks for your work on this. Nevermind, I now see #17.

@ghost
Copy link

ghost commented Jan 29, 2021

Just hit a Error: Cannot find module 'controllers' error when using the hotwire-rails gem on a default Rails app. Does that mean we should bypass hotwire-rails in this case?

@ghost
Copy link

ghost commented Jan 30, 2021

As a follow up, it was a missing index.js that caused the issue: #20 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants