Ruby 3.0.3
Rails 7.0.0.alpha2
After following the instructions to install and usage, I launch the server and I received this error: Uncaught TypeError: Failed to resolve module specifier "stimulus-autoplete". Relative references must start with either "/", "./", or "../".
# app/javascript/controllers/application.js
import { Application } from "@hotwired/stimulus"
import { Autoplete } from "stimulus-autoplete"
# and tried import { Autoplete } from 'stimulus-autoplete/src/autoplete'
const application = Application.start()
application.register('autoplete', Autoplete)
// Configure Stimulus development experience
application.debug = false
window.Stimulus = application
export { application }
Ruby 3.0.3
Rails 7.0.0.alpha2
After following the instructions to install and usage, I launch the server and I received this error: Uncaught TypeError: Failed to resolve module specifier "stimulus-autoplete". Relative references must start with either "/", "./", or "../".
# app/javascript/controllers/application.js
import { Application } from "@hotwired/stimulus"
import { Autoplete } from "stimulus-autoplete"
# and tried import { Autoplete } from 'stimulus-autoplete/src/autoplete'
const application = Application.start()
application.register('autoplete', Autoplete)
// Configure Stimulus development experience
application.debug = false
window.Stimulus = application
export { application }
Share
Improve this question
asked Mar 15, 2022 at 22:21
GuillaumeGuillaume
1,5372 gold badges15 silver badges20 bronze badges
1 Answer
Reset to default 6If you use import maps, did you add "stimulus-autoplete"
in your config/importmap.rb so the lib can be imported?
pin "stimulus-autoplete", to: "https://cdn.jsdelivr/npm/[email protected]/src/autoplete.min.js"
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744939784a4602250.html
评论列表(0条)