alanq

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

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 Pragmatic Bookshelf topics Top

New
iPaul
page 37 ANTLRInputStream input = new ANTLRInputStream(is); as of ANTLR 4 .8 should be: CharStream stream = CharStreams.fromStream(i...
New
johnp
Hi Brian, Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws...
New
mikecargal
Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) It looks like ​.with_simple_console_no_bg​(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |> handle_event() |> render() but the correc...
New
HarryDeveloper
Hi @venkats, It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
adamwoolhether
I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1134 25373 750
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New