hotwired / stimulus

A modest JavaScript framework for the HTML you already have
https://stimulus.hotwired.dev/
MIT License
12.7k stars 424 forks source link

Webpacker 6: Don't know how to build task 'webpacker:install:stimulus' #412

Closed anon987654321 closed 3 years ago

anon987654321 commented 3 years ago

With Webpacker 6 installed:

% rails webpacker:install:stimulus
rails aborted!
Don't know how to build task 'webpacker:install:stimulus' (See the list of available tasks with `rails --tasks`)
Did you mean?  webpacker:install

(See full trace by running task with --trace)

I'm trying to set up StimulusReflex according to https://docs.stimulusreflex.com/hello-world/setup by running rails stimulus_reflex:install, unfortunately it errors out after trying rails webpacker:install:stimulus. This despite Stimulus actually being installed through yarn add stimulus.

@cc webpacker/issues

sergiopantoja commented 3 years ago

OP opened same issue in Webpacker repo: https://github.com/rails/webpacker/issues/3052

Copy/pasting my response from there:

Webpacker 6 doesn't support custom installers anymore. It was removed with this PR here: https://github.com/rails/webpacker/pull/2802/files#diff-8efe491b392a5a50e31b54660bbc0e7258e544e36d4e0b8a65e4cca93d39d18c

I believe you should open an issue with Stimulus Reflex team so they can update their documentation.

marcoroth commented 3 years ago

Hey @anon987654321!

I'm sorry you are experiencing unexpected behavior. The first thing to notice is that Stimulus and StimulusReflex are independent projects.

While StimulusReflex builds on top of Stimulus, Stimulus is not related to StimulusReflex.

The Webpacker 6 Beta removes the custom installers. If you still rely on that installers I would recommend you to keep using Webpacker 5.x until we see a final release of Webpacker 6.

If you need Stimulus in Webpacker 6 I'd recommend you to check out https://github.com/hotwired/stimulus-rails

anon987654321 commented 3 years ago

Thanks @marcoroth for our help both here and over at the Discord 👍 Wish you and @sergiopantoja all the best in the time to come.