Hello! :man-raising-hand: I have an issue with my ...
# gooddata-ui
Hello! 🙋‍♂️ I have an issue with my dashboard plugin that shows fine in a browser, but does not export into PDF 🤔 In the
I included:
Copy code
useEffect(() => {

    const timer = setTimeout(() => {
        console.log('This will run after 10 seconds!');
    }, 10000);
    return () => clearTimeout(timer);
}, []);
My widget (DeckGL + React Map GL) only renders hardcoded data and it displays sooner than most other widgets so 10 seconds should more than be plenty. Any advice? 🙏 Is there a way to debug exports? To simulate how the dashboard would load to be exported?
Cau Jirko, Based on the screenshot I will assume it's GD cloud. You can check what will be exported by simply adding ?displayMode=export URL parameter to the dashboard URL (both GD platform and GD cloud). Also, if you wait longer than 10 seconds, does it eventually render?
Díky Boris! When I append
the map is visible 🤔 And no, waiting longer (e.g., 30 seconds) does not help. Any other ideas?
That's strange... are you using some third party map token? Is there some authorization needed? The exporting tool might not be able to access, but that's just a wild guess. First could you try other browsers/private mode/etc ?
3rd party map token — yes, a mapbox token, but without valid token I would at least expect to see the rendering without the basemap. No authorization, a custom widget with hardcoded data. Let me try other browsers…
Nope, Safari has the same result 😞 I invited you to the workspace, feel free to take a look yourself: https://previous-ladybug.trial.cloud.gooddata.com/dashboards/#/workspace/gdc_demo_d4db3ff4-d316-4407-84[…]board/092929af-375a-4e9c-964f-2add8cdbd259.
I also increased the wait time to 60 seconds. The PDF arrives after ~80 seconds after clicking on "Export to PDF" so the timeout is clearly respected.
I suspect it would be some configuration of mapbox... because it's just the canvas that is empty, other elements are there. I've found some mentions that `
Copy code
preserveDrawingBuffer: true
needs to be added in order it's properly exported to pdf, but not sure how much it applies when it's "embedded" to gooddata
Hello @Jiri Zajic
preserveDrawingBuffer: true
should do the trick, we are doing the same in the MapBox configuration for the export mode, see https://github.com/gooddata/gooddata-ui-sdk/blob/master/libs/sdk-ui-geo/src/core/geoChart/GeoChartRenderer.tsx#L182 I remember we were facing some similar issue (map was not rendered), when this was not set.
👍 1
You guys ROCK! 🚀 Thank you @Boris and @Matyáš Kandl.
🙌 1
I may you with one more thing later (
etc. are crashing my production build while working fine during development), but I'm already discussing with support. I'm preparing a reproducible scenario to share later today…