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 Prag Prog topics Top

jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
leba0495
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
New
leonW
I ran this command after installing the sample application: $ cards add do something --owner Brian And got a file not found error: Fil...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
jskubick
I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. How to replicate: load chapter-7 from zipfile i...
New
brunogirin
When installing Cards as an editable package, I get the following error: ERROR: File “setup.py” not found. Directory cannot be installe...
New
oaklandgit
Hi, I completed chapter 6 but am getting the following error when running: thread 'main' panicked at 'Failed to load texture: IoError(O...
New
akraut
The markup used to display the uploaded image results in a Phoenix.LiveView.HTMLTokenizer.ParseError error. lib/pento_web/live/product_l...
New
rainforest
Hi, I’ve got a question about the implementation of PubSub when using a Phoenix.Socket.Transport behaviour rather than channels. Before ...
New
andreheijstek
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New

Other popular topics Top

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
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
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
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New

Latest in PragProg

View all threads ❯