Skip to content

[question] Element with ID #326

@richjdsmith

Description

@richjdsmith

I am not sure where else to turn. I am getting this error code in VScode:

Element with id /home/richsmith/workspace/retiredmortgages/app/javascript/controllers/countchars_controller.js-countchars-true is already registered

I am at a loss as to what this means and what's causing it.

The controller itself is super simple:

import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
  static targets = ["name", "counter"]
  connect() {
    console.log("Countchars controller connected")
  }

  countCharacters(event) {
    let characters = this.nameTarget.value.length;
    this.counterTarget.innerText = characters;
  }
}

But no matter what I do, this error lives on. Any suggestions? place to turn?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions