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

Updating from 1.1.3 to 1.1.4 no longer executes any stimulus code (Rails 7) #142

Closed
agrieser opened this issue Jul 15, 2022 · 3 comments · Fixed by #143
Closed

Updating from 1.1.3 to 1.1.4 no longer executes any stimulus code (Rails 7) #142

agrieser opened this issue Jul 15, 2022 · 3 comments · Fixed by #143

Comments

@agrieser
Copy link

Rails 7 + Turbo + Stimulus

Using importmap-rails 1.1.3, everything works as expected
Updating to importmap-rails 1.1.4, no stimulus code is executed
Reverting to importmap-rails 1.1.3, everything works as expected

There's really nothing special about this app. Rails 7, using out of the box configuration for Turbo and Stimulus.

In app/javascript/controllers/application.js I added a log line to see if the browser was executing the file at all:

import { Application } from "@hotwired/stimulus"

const application = Application.start()

// Configure Stimulus development experience
application.debug = false
window.Stimulus   = application

console.log("executing js");
export { application }

Using importmap-rails 1.1.3, I see the log line displayed in chrome's console
Using importmap-rails 1.1.4, the log line is not displayed in chrome's console
Reverting to importmap-rails 1.1.3, the log line is again displayed in chrome's console.

There are no additional errors displayed in either the build process (using rails bin/dev) or in chrome.

@rmacklin
Copy link
Contributor

I suspect this is related to the issue mentioned in #139 (review)

@rmacklin
Copy link
Contributor

I've opened #143 to address the issue spotted in #139 (review). @agrieser can you test out that PR and see if it fixes your issue?

@dhh dhh closed this as completed in #143 Jul 15, 2022
@agrieser
Copy link
Author

I've opened #143 to address the issue spotted in #139 (review). @agrieser can you test out that PR and see if it fixes your issue?

Confirmed this fixes it. Thanks 👍

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

Successfully merging a pull request may close this issue.

2 participants