utils.serializePage() not returning anything

I'm trying to download a retool mobile screen as a PDF and see there is a util to do that, but when I run it nothing happens. I then tried the serializePage function to see if that would return the rendered pdf data but when I run it I get nothing returned in results and if I log to console I get {}.

I created a simple test page to make sure it wasn't to do with the components in the page I was trying to download, this test page only has a text field and a button which triggers running the JS.

I've read the docs and the forum and can't find any reason this returns nothing. Anyone any ideas?

Thanks, Colin

2 Likes

Hi @ccaskey, this is definitely a bug. The value of your variable serializedPage should be the current Retool page as a Base64-encoded PDF string.

I was able to reproduce this issue on my end. We created the internal bug report and will update you here when is fixed.

Thank you for surfacing this!

Update: We don't support utils.serializePage() on Mobile.

This is also happening to me on a normal web App.

Hi @David_Paez, could you share a screenshot of your code?
I'm not able to reproduce this issue on web apps:

Is there anything else you need?

This is great, thank you!

Is this happening in Cloud or are you using a specific Self-hosted version?

Hey @ccaskey, I checked internally and this is not a bug. We currently don't support serializePage on Mobile. I noticed this is not clear in our documentation so I made an internal feature request to include this specification. Similarly, I created a feature request to support this functions on Mobile.

I'll update you here with any news on this feature. :slightly_smiling_face:

I'm sorry for the confusion.

Great, thanks Paulo.

1 Like

You are welcome!

This is using the cloud version.

That's odd! It should be working smoothly on Cloud:

What browser and version are we on?

I'm using the latest release of Chrome, and s still not working. Console log shows undefined and no results are returned.

Edit:

I'm also testing with including the container selected to download but also not working:

Hi @David_Paez, we haven't been able to reproduce this issue.

Could you try disabling all Chrome extensions and plugins?
Could you also check if we have any Preloaded JS?

It is March 2025 and I am also running into this same issue. Does anyone know if there is any update on this or is there some fix? I notice that some people have been able to get it to work but most have not. If anyone has gotten it to work what was your solution?

Thanks for reaching out, @neilbalthaser. Are you on a Cloud instance? You can check the specific version in the editor UI.

I just tested serializePage on my end and it seems to be working, but there could very well be some confounding variables. It might be helpful to get an export of your app that includes hard-coded query results.

Just checking in - is this still an issue for either of you, @David_Paez and @neilbalthaser?

@Darren my version is: * Retool version 3.198.0

I just tried again: setup a query:
const base64 = await utils.serializePage();
console.log (Here is the serialized page: ${base64});

and got:
[query1] Here is the serialized page: undefined

1 Like

Super strange. :thinking: Is this happening on every app or just one in particular? If you haven't already, I'd recommend creating a brand new app and running the same query just to answer this question.

My current hunch is that serializePage might be broken in certain early versions of multipage apps - or maybe those that were converted from single page apps. If it works as expected in a brand new app, then you should be able to export re-import your app JSON.