
alanq
Modern Front-End Development for Rails: Can't get TURBO_STREAM format in some cases
This isn’t directly about the book contents so maybe not the right forum…but in some of the code apps (e.g. turbo/06) it sends a TURBO_STREAM request and in others (e.g. turbo/01) it’s always HTML, even from a link inside a turbo_frame.
No doubt it is something in my environment. I’ve gone through diffs painstakingly setting every yarn package version etc. to match the working app where different. But I can’t get a TURBO_STREAM in a new rails project or in some of the sample code apps.
I know there are a million combination of versions of everything so this is an impossible question to answer, but any suggestions?! I’ve tried reinstalling everything a million times. The new version of the book is great, I’d love to put it into use but guess I’ll have to wait a few months and try again.
Most Liked

alanq
Hi, you’re right turbo/02 does work.
I took a fresh copy of the code. turbo/01 sends HTML rather than TURBO_STREAM, so maybe it’s just not set up at that point.
Thanks that reduced the variables, it’s the turbo-rails gem version that breaks for me from v0.5.4 It won’t send a TURBO_STREAM (same on latest v0.5.9).
Looking forward to continuing the book with the older turbo-rails gem for now, thanks.
UPDATE: If I run yarn upgrade
it breaks again, even with turbo-rails gem v0.5.3
But if I then paste the older yarn.lock lines back in for turbo-rails and turbo and run webpacker:install, it works again. Even though the version @hotwired/turbo-rails@^7.0.0-beta.2
is the same in both cases, yarn upgrade changes the t.r. version referenced below from beta.2 to beta.5 (and the turbo dependency from beta.1 to beta.4).
Pasting back to beta.2 and beta.1 for turbo-rails and turbo resp. fixes it (ie TURBO_STREAM requests).
So reverting to the red below fixes it. I’ve no idea if that’s significant!
Unrelated but it seems the target type declaration is no longer needed (happy days): Uncaught (in promise) TypeError: setting getter-only property "elementToHideTarget"
Removing elementToHideTarget: HTMLElement
fixes it
Popular Prag Prog topics










Modern front-end development for Rails, second edition - Struggling to get the first chapter to work
Other popular topics









Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /scala
- /zig
- /html
- /debian
- /nixos
- /lisp
- /agda
- /sublime-text
- /textmate
- /react-native
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /django
- /spring
- /diversity
- /lua
- /nodejs
- /julia
- /slackware
- /c
- /neovim