Giter Club home page Giter Club logo

Comments (6)

leastbad avatar leastbad commented on September 3, 2024 1

Hi Luis! I'm really sorry that you're having such a weird and frustrating problem. I'm in the process of trying to recreate it. In particular, it's the first time I've heard of a problem being specific to the nodetype of the element the controller is placed upon.

Are you on our Discord server? It might be easier to get help in the future.

Also, I just want to say that this is a near-perfect issue submission. I appreciate that it's difficult to set up a reproduction example when there's a server component. All of this detail can really help us help you faster.

from stimulus_reflex.

LuisDeHaro avatar LuisDeHaro commented on September 3, 2024 1

@hopsoft, you are right. The element that fires the reflex needs to have a unique id.

In my case the simple_form_for was the culprit, and adding an id to the form fixed the issue:

<%= simple_form_for :service_schedule, data: { controller: "serviceschedule", reflex_root: "#search-results" }, html: { method: :post, id: :search_service_schedules_form } do |f| %>

<% end %>

Thanks!

from stimulus_reflex.

LuisDeHaro avatar LuisDeHaro commented on September 3, 2024

Hi @leastbad, thanks for your quick response.

Don't worry, it's been a pleasure to use this gem, other than this small hiccup the library is working like a charm.

I just joined the Discord server: Luis de Haro, I'll keep this in mind in case of any future issue.

And thank you for all your help if you need any further detail, just let me know.

from stimulus_reflex.

leastbad avatar leastbad commented on September 3, 2024

@LuisDeHaro could I get you to update your gem to 2.2.2 and make sure you also yarn update your JS package, too. I always forget.

from stimulus_reflex.

LuisDeHaro avatar LuisDeHaro commented on September 3, 2024

@leastbad, sure. I just did and now the issue has changed.

It throws an error immediately after I enter to the page that has the table you see in the above gifs. Error:

application.js:250 Error connecting controller

TypeError: this.getConfig is not a function
at createConsumer (action_cable.js:25)
at getConsumer (consumer.js:26)
at createSubscription (stimulus_reflex.js:67)
at Object.register (stimulus_reflex.js:161)
at Controller.connect (application_controller.js:6)
at Controller.connect (serviceschedule_controller.js:20)
at Context.connect (context.js:23)
at Module.connectContextForScope (module.js:39)
at Router.scopeConnected (router.js:100)
at ScopeObserver.elementMatchedValue (scope_observer.js:55)

{identifier: "serviceschedule", controller: Controller, element: form.simple_form.service_schedule}
identifier: "serviceschedule"
controller: Controller {context: Context, StimulusReflex: {…}, stimulate: ƒ, __perform: ƒ}
element: form.simple_form.service_schedule
proto: Object

Also, I don't get the channel subscription confirmation like before. I don't get this:

StimulusReflex::Channel is transmitting the subscription confirmation
StimulusReflex::Channel is streaming from StimulusReflex::Channel:1

After the yarn upgrade, the stimulus_reflex package looks like this in the yarn.lock:

[email protected]:
version "2.2.2"
resolved "https://registry.yarnpkg.com/stimulus_reflex/-/stimulus_reflex-2.2.2.tgz#0bc46bfbb442f2cf980e3436f16282c92924f6fd"
integrity sha512-X0QCohbGcBngoUmG5mDXFsVzcBgvKUWAMYSPfrv2eN72IkZqn+vGQFeC3sJncU2t9WIqbRu52/PgBFn7KHbhYQ==
dependencies:
actioncable ">= 5.2"
cable_ready ">= 4.0"
inflected ">= 2.0"
stimulus ">= 1.1"

Please let me know if you need some more info, I'll be glad to help. Thanks in advance!

from stimulus_reflex.

hopsoft avatar hopsoft commented on September 3, 2024

@LuisDeHaro Try adding a unique id to your anchor elements that define data-reflex=...

from stimulus_reflex.

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.