error ...
in the browser console (Safari), it display the error:
SyntaxError: Unexpected string literal "@hotwired/turbo-rails". import call expects one or two arguments.
This error points to application.js.
Is this yet another rails error than can be safely ignored, is it an indication my set-up is not quite right? Is it a bug?
gemfile includes...
gem "cssbundling-rails", "~> 1.1"
gem 'turbo-rails'
gem 'importmap-rails'
importmap.rb
pin "application", preload: true
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
pin "popper", to: 'popper.js', preload: true
pin "bootstrap", to: 'bootstrap.min.js', preload: true
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin "trix"
pin "@rails/actiontext", to: "actiontext.js"
pin "stimulus-autocomplete", to: "https://ga.jspm.io/npm:[email protected]/src/autocomplete.js"
pin "choices" # @10.2.0
pin_all_from "app/javascript/controllers", under: "controllers"
application.js
import "@hotwired/turbo-rails"
import "popper"
import "bootstrap"
import "controllers"
import * as bootstrap from "bootstrap"
package.json
{
"name": "flightrecord",
"private": "true",
"dependencies": {
"@fortawesome/fontawesome-free": "^6.2.0",
"@hotwired/stimulus": "^3.2.1",
"@hotwired/turbo-rails": "7.2.4",
"@popperjs/core": "^2.11.6",
"@rails/actioncable": "^7.0.3-1",
"@rails/actiontext": "^7.0.4",
"@rails/activestorage": "^7.0.3-1",
"@rails/webpacker": "5.4.3",
"bootstrap": "^5.2.3",
"bootstrap-icons": "^1.10.2",
"choices.js": "^10.2.0",
"currency.js": "^2.0.3",
"dropzone": "^5.9.2",
"sass": "^1.56.2",
"sortablejs": "^1.14.0",
"stimulus-autocomplete": "^3.0.0-rc.2",
"tributejs": "^5.1.3",
"trix": "^2.0.3"
},
"version": "0.1.0",
"devDependencies": {
"webpack-dev-server": "^3"
},
"engines": {
"node": "19.2.0",
"yarn": "1.22.19",
"npm": "6.14.9"
},
"scripts": {
"build:css": "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules"
}
}