Comments (13)
Discovered that defining the targets using static get targets()
instead of static targets = […]
fixes it. This is noted in the Stimulus Handbook as part of using Stimulus without a build system, although I didn't have to load Stimulus in a <script>
tag as suggested. I suspect that's because the asset pipeline is loading it.
from stimulus-rails.
Yeah, in chrome and firefox I am getting this error,
Unable to resolve specifier 'dropdown_controller' from http://localhost:3000/assets/stimulus/loaders/autoloader-509ae5af683e0569f53f8d5579fdf5bf52fea27382db2ab692a6413626253ff4.js"
stack: "throwUnresolved@http://localhost:3000/assets/stimulus/libraries/es-module-shims-c4493e644afb380789c8f0d44266900b8631ec442f8f95886997dac9f98893f1.js:472:11\nresolve@http://localhost:3000/assets/stimulus/libraries/es-module-shims-c4493e644afb380789c8f0d44266900b8631ec442f8f95886997dac9f98893f1.js:468:99\nimportShim$1@http://localhost:3000/assets/stimulus/libraries/es-module-shims-c4493e644afb380789c8f0d44266900b8631ec442f8f95886997dac9f98893f1.js:267:25\nautoload/</<@http://localhost:3000/assets/stimulus/loaders/autoloader-509ae5af683e0569f53f8d5579fdf5bf52fea27382db2ab692a6413626253ff4.js:12:17\nautoload/<@http://localhost:3000/assets/stimulus/loaders/autoloader-509ae5af683e0569f53f8d5579fdf5bf52fea27382db2ab692a6413626253ff4.js:9:21\nautoload@http://localhost:3000/assets/stimulus/loaders/autoloader-509ae5af683e0569f53f8d5579fdf5bf52fea27382db2ab692a6413626253ff4.js:6:62\n@http://localhost:3000/assets/stimulus/loaders/autoloader-509ae5af683e0569f53f8d5579fdf5bf52fea27382db2ab692a6413626253ff4.js:19:1\n"
Which unfortunately I have my file in the correct location, but I don't have any other clue how to solve this. Even my hello_controller fails to autoload.
from stimulus-rails.
Having this issue in Chrome. No, other output than Failed to autoload controller.
from stimulus-rails.
I'm seeing a related issue using desktop Safari v14.0.3. I generated a new Rails 6.1.3 app without webpack, and followed the steps here:
https://github.com/hotwired/stimulus-rails
The simple hello world controller works, but the advanced version fails to autoload the controller:
No issue using Chrome or Firefox though.
from stimulus-rails.
I was actually able to clear this issue for the time being. I really don't know what fixed it, but I removed my public/assets folder completely and also ran a rails assets:clobber
, then re-ran rails hotwire:install
everything seems okay for the time being. Thank you!
from stimulus-rails.
I fixed this error by removing
<%= stimulus_include_tags %>
from <head>
Since I'm using webpacker, I didn't need it
from stimulus-rails.
It is also not working on chromium for ubuntu when you use a multiple word controller such as hello_world_controller and specify in html as data-controller="hello-world"
from stimulus-rails.
Closing ticket. Seems like Safari glitch. Unable to reproduce.
Similar issue on stackoverflow.
Safari also does not like setting breakpoints on fingerprinted files, so changing my config to not do that helped.
config.assets.digest = false
from stimulus-rails.
My issue was todo with "access control checks" in Safari and I don't think it's anything todo with autoloader, because sometimes it worked fine in Safari and it has not happened since.
@cgibsonmm Try setting a breakpoint in Chrome web inspector to get the error #12
from stimulus-rails.
@cgibsonmm It might be good to create an issue for it and the steps you used to install Hotwire and where you put all the files. Can you upload the repo somewhere if it’s just a play project?
I’ve found that usually it’s my mistake and the error is swallowed which will be fixed soon.
from stimulus-rails.
Yeah, I will open an issue. I will see if I can recreate it, in a new app.
from stimulus-rails.
I just experienced this today. Same error.
Safari 14.0.3
Catalina 10.15.7
rails 6.1.0
hotwire-rails 0.1.3
I am using the standard asset pipeline, and not webpacker
from stimulus-rails.
I thought this was the case. Also, it may be fixed to support the standard static targets (and values), when Safari Technology Preview 117 is made part of the release of the main safari, which could be march (I am not sure when these go into the main branch).
from stimulus-rails.
Related Issues (20)
- Controllers written in Coffeescript? HOT 1
- why not auto "rails stimulus:manifest:update"
- Failing to register controllers does not bubble the error to handleError HOT 1
- stimulus-rails installation rails - undefined method Stimulus::Rails.application HOT 1
- manifest:update configuration for controller segmentation HOT 1
- Should controller names be registered as camelCase? HOT 2
- rails stimulus:manifest:update replacing our index.js configs HOT 1
- 404 on assets/stimulus-loading.js with config.assets.digest set to false HOT 11
- Mutation Observer not recognising DOM change when using Turbo Streams HOT 2
- Browser Back button is not working for some feature in stimulus HOT 2
- Console error with lazyLoadControllersFrom and external controller HOT 1
- Add typescript support for rails stimulus generator
- Action params not populating HOT 1
- Debugging `Failed to auto-load controller` ... `Unable to resolve specifier` HOT 2
- Error when passing JSON formatted data from rails to stimulus HOT 1
- Stimulus broken in Firefox 115+ with importmap-rails HOT 4
- Is it possible to use controllers stored in a GEM ?
- ActiveModel not working with value to Object HOT 2
- Add stimulus:manifest:update to the tasks description HOT 1
- Error in lib/install/stimulus_with_node.rb
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stimulus-rails.