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

Where Next?

Popular Pragmatic Bookshelf topics Top

abtin
page 20: … protoc command… I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
New
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |> handle_event() |> render() but the correc...
New
cro
I am working on the “Your Turn” for chapter one and building out the restart button talked about on page 27. It recommends looking into ...
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
jskubick
I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint. As entered, the SwitchCompat changes color to hol...
New
jgchristopher
“The ProductLive.Index template calls a helper function, live_component/3, that in turn calls on the modal component. ” Excerpt From: Br...
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 I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
New
s2k
Hi all, currently I wonder how the Tailwind colours work (or don’t work). For example, in app/views/layouts/application.html.erb I have...
New
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
AnfaengerAlex
Hello, I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
New

Sub Categories: