Description
I initially added this as Rails issue (still open). But, as I dug deeper I was able to narrow this down specifically to Propshaft (or so it seems for now...I will continue digging). I can't see that much has changed from 1.0.0 to 1.0.1, but I can reliably and repeatedly resolve and introduce this error by switching back-n-forth from those versions or Propshaft.
Here's the issue I submit in rails/rails.
Upgrading a Rails 7.2 app to Rails 8. Everything went smooth except something is happening with javascript--it's not loading.
My existing app/javascript/application.js file includes:
import "@hotwired/turbo-rails"
import "./controllers"
import * as bootstrap from "bootstrap"
Upon upgrading to Rails 8.0.0.beta1, I get the following error in the browser console:
SyntaxError: Unexpected string literal "@hotwired/turbo-rails". import call expects one or two arguments.
Just for grins I uninstalled Hotwire and reinstalled. The installer moved import "@hotwired/turbo-rails" to the bottom of application.js. Upon reloading the browser I now get this error:
SyntaxError: Unexpected string literal "./controllers". import call expects one or two arguments.
Expected behavior
Nothing in this regard has change in Rails 8, so not sure why the new errors. The reason I am submitting this as a bug, and not simply to SO is because "./bin/rails turbo:install" puts "import '@hotwired/turbo-rails'" into the application.js file---resulting in this error.
System configuration
Rails version: 8.0.0.beta1
Ruby version: 3.3.5