-
Notifications
You must be signed in to change notification settings - Fork 425
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
Using generator causes duplicative references in app/javascript/controllers/index.js
#739
Comments
This is a stimulus-rails issue would you mind opening this issue on that repo. |
Is this reproducable? @jasonfb |
Let me work on that. It's happened for me pretty much every time I run the stimulus generator (as far as I can remember, it's always happened to me as long as I can remember) FWIW, I build apps using JSBundling, maybe that has something to do with it. I will create a reproduction app now to see if I can reproduce it |
@jasonfb is it possible you have I was able to reproduce in a test environment with // This file is auto-generated by ./bin/rails stimulus:manifest:update
// Run that command whenever you add a new controller or create them with
// ./bin/rails generate stimulus controllerName
import { application } from "./application"
import CoffeeController from "./coffee_controller"
application.register("coffee", CoffeeController)
import HelloController from "./hello_controller"
application.register("hello", HelloController)
import HelloController from "./hello_controller"
application.register("hello", HelloController)
import TypeScriptController from "./type_script_controller"
application.register("type-script", TypeScriptController) |
@jasonfb I've created a PR to fix this issue: hotwired/stimulus-rails#132 |
Closing this here as it is related to the stimulus-rails gem PR candidate : hotwired/stimulus-rails#132 |
Here I went to make a new stimulus controller with
the generator did this, added it to the
app/javascript/controllers/index.js
but then also added duplicative references to two other stimulus controllers that were already in my app:(If you look carefully at the left margin, you see where my IDE has highlighted the newly added code
import CheckoutController...
andimport OnboardingStartController ...
below two lines of identical code.)interestingly, it has not done the same for a 3rd controller listed in this file, don't know why.
is this a known issue?
I'm on Stimulus-rails 1.2.1
The text was updated successfully, but these errors were encountered: