Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

the render result is __hypernova_render_token[0]__? #15

Closed
loatheb opened this issue May 12, 2017 · 3 comments
Closed

the render result is __hypernova_render_token[0]__? #15

loatheb opened this issue May 12, 2017 · 3 comments

Comments

@loatheb
Copy link

loatheb commented May 12, 2017

I'm not sure, but sometime when I open a site use SSR with hypernova-ruby and hypernova-react, the site shows a __hypernova_render_token[0]__

also, I notice the node hypernova server doesn't log things about the request? Is that means the request is timeout in hypernova-ruby?

Thanks

@loatheb
Copy link
Author

loatheb commented Jul 5, 2017

The reason is when our site use the cache, ruby running the hypernova_batch_before and hypernova_batch_after but doesn't run the render_react_component among them. So that the token doesn't be replaced in hypernova_batch_after and absolutely not send the request to the hypernova server.

At last, we remove the memory cache in our code, after that, it works well.

@loatheb loatheb closed this as completed Jul 5, 2017
@jtamary
Copy link

jtamary commented Aug 7, 2017

The problem is that the hypernova writes the result to response.body and the caches_action reads from response_body.

A hacky solution we found to this problem is rewriting response_body[0] in the page controller.
response_body[0] = response.body

we don't like it. :\ but it should work.

Another solution is writing your own cache mechanism in a higher level where you have the whole body.

@maloky
Copy link

maloky commented Mar 11, 2019

Hi.

I've been struggling with a similar issue. In my case i'm trying to get the returned html to be rendering in pdf format. But it only displays correctly if i add the parameter to show_as_html to true. what's the big diference of render the result as html instead of pdf? shoudn't the render to string return the same?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants