hotwired/turbo-rails

import "@hotwired/turbo-rails" errors

zhugexinxin opened this issue · 1 comments

  1. remove importmap-rails
  2. yarn add @hotwired/turbo-rails ^8.0.4
  3. import "@hotwired/turbo-rails" add application.js

result for submit form:
image

rails version 7.1.3

work out it
change to @hotwired/turbo-rails ^7.3.0

@zhugexinxin from those errors it seems that you're importing an ESM module with a <script type="text/javascript"> tag. Can you check in the <head> of your page, and see if changing it to <script type="module"> helps?