Turbo fetches content, but never renders

Turbo seems like the type of thing that will make the small apps I build much easier to build out but a very basic example seems to be impossible for me to create.

Example: http://hotwiretest-7hcc2.ondigitalocean.app

Trying lazy-loading and user initiated rendering but in all cases the HTML is fetched in the background but never rendered. I’m sure there’s something very obvious I’m doing wrong, I just can’t tell what it is!

Any help would be greatly appreciated.

I have the same issue. I got everything up and working. Network requests seem to resolve successfully, but the results are not rendered.

@cchana

Found something, not really shown in the reference pages of the documentation, which made the difference on my side: You need the turboframe with the same ID on the page you request.

Can you show a piece of your code?

Only by example.

Like in my case, I have a statically generated HTML front-end and a separate PHP back-end. I load a form I already have prepared on a PHP page, into an individual HTML page on another server.

On the PHP page I have this (this is thew piece I want to load)

<?php

Some other content on this page.....

<turbo-frame id="question-form">
  <some HTML>
  </some HTML>
</turbo-frame>

On the HTML front-end I have this:

<turbo-frame id="question-form" src="https://myphpapplication/myformpage">
</turbo-frame>

Both share the same ids, thus when I open the HTML page, it will render the HTML, then request the php page from the php application and render it in the turbo-frame of the HTML page.

In the reference documentation of Turbo Frame, that piece with requiring the turbo-frame with the same ID in the page that contains the snipped you want to load, seems missing (but rather important).

Yeah, it indeed requires the frame id on the final response template

Thank you, I changed my IDs after experiencing a different issue and never tried putting them back. Knew it was something simple!

The thought crossed my mind but it seemed a little counter-intuitive to have the same IDs but looking at the source that is generated after the HTML is loaded it makes sense now.

Thanks again!

1 Like