As Michiel said:
We use a fixed 30 second timeout for the page to finish loading and rendering. A timeout exception is thrown if the page content did not finish loading within 30 seconds.
Widgets or add-ons for your index.html
file that perform long polling network requests are not supported. The document generation service waits until there are no more pending network requests.
Check also this specific bullet point:
https://docs.mendix.com/appstore/modules/document-generation/#624-timeout-errors
If you really need the complete document and it is complex, there are several avenues to explore:-
I am not sure, but maybe you are experiencing either bullet 3 or 4 of the limitations?
https://docs.mendix.com/appstore/modules/document-generation/#12-limitations
I recently faced this same issue and everything seemed correct – Chrome was installed, constants were properly configured, I even tested with a clean page, etc.Still, the error persisted: "Timeout while waiting for document result."
The definitive solution in my case was to add a Call Microflow activity that runs ASu_DocumentGeneration_Initialize inside my StartDeeplink microflow.
Hope this helps someone as lost as I was.