hotwired / turbo-rails

Use Turbo in your Ruby on Rails app
https://turbo.hotwired.dev
MIT License
2.09k stars 322 forks source link

import "@hotwired/turbo-rails" errors #625

Closed zhugexinxin closed 2 weeks ago

zhugexinxin commented 5 months ago
  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

afcapel commented 5 months ago

@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?