in development everything work fine, but in heroku it don’t work. I add to HTML as wrote in stimulus docs: ``
Greet
```
and add to hello_controller.js in connect()
```
console.log("it works")
```
and this don't work on heroku(msg in console didn't appear also). Importmap, index.js, application.js and manifest.js seems good:
manifest.js:
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
//= link custom.css
index.js:
// Import and register all your controllers from the importmap under controllers/*
import { application } from "controllers/application"
// Eager load all controllers defined in the import map under controllers/**/*_controller
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
eagerLoadControllersFrom("controllers", application)
// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
// import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
// lazyLoadControllersFrom("controllers", application)
application.js:
import { Application } from "@hotwired/stimulus"
const application = Application.start()
// Configure Stimulus development experience
application.debug = false
window.Stimulus = application
export { application }
importmap.rb:
pin "application", preload: true
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin_all_from "app/javascript/controllers", under: "controllers"
pin "popper", to: 'popper.js', preload: true
pin "bootstrap", to: 'bootstrap.min.js', preload: true
in application.html.erb related to js only:
<%= javascript_importmap_tags %>
there is only one clue:
Uncaught TypeError: Failed to resolve module specifier "application". Relative references must start with either "/", "./", or "../".
it shouldn’t appear in chrome but it appears in production. Heroku logs show that everything fine, when deploying also everything fine except:
Stopping all processes with SIGTERM
Process exited with status 143
but google say it not big problem. Here additional gem that i added:
gem "devise", "~> 4.8"
gem 'bootstrap', '~> 5.1.3'
gem "sassc-rails"
gem "rails-controller-testing"
gem "will_paginate", "~> 3.3"
group :production do
gem "pg", "1.3.5"
end
Will appreciate for any help