Giter Site home page Giter Site logo

Comments (13)

clarkware avatar clarkware commented on July 28, 2024 6

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.

cgibsonmm avatar cgibsonmm commented on July 28, 2024 4

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.

cgibsonmm avatar cgibsonmm commented on July 28, 2024 3

Having this issue in Chrome. No, other output than Failed to autoload controller.

from stimulus-rails.

clarkware avatar clarkware commented on July 28, 2024 3

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:

Screen Shot 2021-02-23 at 12 20 42 PM

No issue using Chrome or Firefox though.

from stimulus-rails.

cgibsonmm avatar cgibsonmm commented on July 28, 2024 1

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.

oclef avatar oclef commented on July 28, 2024 1

I fixed this error by removing

<%= stimulus_include_tags %>

from <head>

Since I'm using webpacker, I didn't need it

from stimulus-rails.

enochtamulonis avatar enochtamulonis commented on July 28, 2024

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.

 avatar commented on July 28, 2024

Closing ticket. Seems like Safari glitch. Unable to reproduce.

Similar issue on stackoverflow.

https://stackoverflow.com/questions/63141448/safari-fetch-api-cannot-load-due-to-access-control-checks-after-reload

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.

 avatar commented on July 28, 2024

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.

 avatar commented on July 28, 2024

@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.

cgibsonmm avatar cgibsonmm commented on July 28, 2024

Yeah, I will open an issue. I will see if I can recreate it, in a new app.

from stimulus-rails.

dmlond avatar dmlond commented on July 28, 2024

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.

dmlond avatar dmlond commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.