hotwired/turbo-rails

Minify Issue after updating from 8.0.5 to 8.0.6 with turbo-rails 8.0.5 to 8.0.9

Closed this issue · 5 comments

I updated the following in my Ruby on Rails application:

Ruby from 3.3.4 to 3.3.5
@hotwired/turbo-rails from 8.0.5 to 8.0.9
@hotwired/turbo from 8.0.5 to 8.0.6

Since then, I have encountered the following error when running the following build command:

"build": "esbuild app/javascript/application.js --bundle --minify --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets"

here is the error in chrome dev tools:

TypeError: ya is not a function at ga (application-d5a03decd2bd9279296b1b2ff8e830402602a10d03729eb393ef1d31d14bb401.js:6:3019) at pi (application-d5a03decd2bd9279296b1b2ff8e830402602a10d03729eb393ef1d31d14bb401.js:6:3098) at Qn.canPrefetchRequestToLocation (application-d5a03decd2bd9279296b1b2ff8e830402602a10d03729eb393ef1d31d14bb401.js:20:37313) at #i (application-d5a03decd2bd9279296b1b2ff8e830402602a10d03729eb393ef1d31d14bb401.js:20:18978) ga @ application-d5a03decd2bd9279296b1b2ff8e830402602a10d03729eb393ef1d31d14bb401.js:6 pi @ application-d5a03decd2bd9279296b1b2ff8e830402602a10d03729eb393ef1d31d14bb401.js:6 canPrefetchRequestToLocation @ application-d5a03decd2bd9279296b1b2ff8e830402602a10d03729eb393ef1d31d14bb401.js:20 #i @ application-d5a03decd2bd9279296b1b2ff8e830402602a10d03729eb393ef1d31d14bb401.js:20

If I don't minify my application file with Turbo, it works fine. Is this a problem related to the update?

The problem lies with esbuilding.
When I use --tree-shaking=false, the error no longer occurs.
But it only is a Problem after the recent update,

@izu23 I'm using a similar setup, same build step. Just upgraded, not seeing that error.

Node 22.8.0

Hey folks I released 8.0.10 today for both turbo and turbo-rails. Is the problem still happening with this one?

after using nvm 22.8.0 it works.