Closed zealot128 closed 2 months ago
I was able to downgrade with:
bin/importmap pin @hotwired/turbo-rails@8.0.4
not sure if this is a designed/sanctioned feature but it worked!
I released turbo@8.0.6
and then published turbo-rails@8.0.6
including it. I found some problems that look like a cache-propagation issue in npmjs. It's still not detecting 8.0.6 as the latest and, when forced, it hangs and eventually timeouts:
./bin/importmap pin @hotwired/turbo-rails@8.0.6
I also had some issues with npmjs failing to reflect the last version I had pushed for about 30 minutes. During my tests, I pushed two new versions for the turbo-rails
gem (8.0.7 and 8.0.8). Once we sort this out, I'll align the turbo
version with this one package.
I'll see if it's a matter of waiting a bit to see if npmjs picks the right version.
I suspect the original problem here could be the package.json lacking an "export" section as explained here: https://jspm.org/jspm-dev-release#subpath-detection. When not provided, jspm infers which packages should be exported using some statistical analysis. It seems here it decided that cable.js
was to be exported so it didn't inline them. I couldn't find any change on our side that could explain the change between 8.0.4 and 8.0.5.
I'll see if adding that helps.
@zealot128 ok the problems with JSPM are sorted out now (see https://github.com/jspm/generator/pull/382).
Regarding the orginal problem, I think this fix did it, cable.js is inlined now:
https://ga.jspm.io/npm:@hotwired/turbo-rails@8.0.9/app/javascript/turbo/index.js
I'll bump turbo to match versions before closing this one.
I just released v8.0.10
for turbo and turbo-rails and v2.0.8
for the gem.
@jorgemanrubia Awesome! Thanks for the investigation & quick fix!
I was trying to use Turbo-Rails with importmaps by using turbo installer, which downloaded the files into vendor. I then got error messages in the console about a missing file:
So I checked the vendor/javascript folder and found
vendor/javascript/@hotwired--turbo-rails.js
to be importing the specified file. Tried repinning, and saw that it downloaded from ga.jspm, so, you can see, the broken import is here too:https://ga.jspm.io/npm:@hotwired/turbo-rails@8.0.5/app/javascript/turbo/index.js
seems to correlate with the cable.js import/export in https://github.com/hotwired/turbo-rails/blob/main/app/javascript/turbo/index.js
When checking previous version 8.0.4 https://ga.jspm.io/npm:@hotwired/turbo-rails@8.0.4/app/javascript/turbo/index.js
it seems that it inlines the whole consumer/cable stuff.
So I tried replacing the vendored file with 8.0.4 directly, as I found no way do "downgrade" using importmaps.
And, the error is gone.