Helmut said over 3 years ago on Autocomplete with StimulusJS :
Hi! Any advice how to troubleshoot the Stimulus controller not activating at all? I created the same sample app you used, and got things working fine, and as I type into the Author field, I can see Rails responding to the keypresses in the terminal log, and I can see the search results appear in the browser.

But then I tried to implement autocomplete in a bigger app I've been working on for a while, and it does NOT show any auto-complete results, and there's no activity in the Terminal logs when typing in the field. Makes me think that the Stimulus controller is not firing, but I'm not sure how to troubleshoot. I've double-checked all my code for errors, and found none.

One thing I wonder about is when I installed stimulus-autocomplete in this bigger project, yarn gave me a few errors/warnings (see below). Could it be that the stimulus controllers didn't install properly (I don't have much experience installing dependencies)? Any other suggestions for how to figure out why the Javascript is not responding to key inputs?

THANKS MUCH!



yarn add v1.22.5
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
warning np@6.5.0: The engine "git" appears to be invalid.
[3/4] 🔗  Linking dependencies...
warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0".
[4/4] 🔨  Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ stimulus-autocomplete@1.4.0
info All dependencies
└─ stimulus-autocomplete@1.4.0
✨  Done in 3.59s.