Closed lukeobvio closed 3 months ago
Hi @lukeobvio, sorry to hear about this.
I couldn't repro the behaviour you described. Could you give us the snippet of code you use for rendering the dashboard? That might help us investigate what is happening.
Also, is there any console error with more details, or any more info in the the network request response? Is it "failed to fetch" all charts in the dashboard? A screenshot will be great 🙏
Hi @kristinamongo, thank you for your quick response!
Yes, I get the "Failed to Fetch" error when the entire dashboard screen is loading - once the individual dashboards show up as "loading", it goes on to succeed. Here's the code snippet that is rendering the dashboard:
const sdk = new ChartsEmbedSDK({
baseUrl,
});
const dashboard = sdk.createDashboard({
dashboardId,
getUserToken: idToken,
});
const element = document.getElementById('mongo');
const mongo = element as HTMLElement;
dashboard.render(mongo).catch((e) => {
console.log(Mongo Error);
console.log(e);
if (retryMongo) {
setRenderError(true);
setRetryMongoRender(false);
} else {
setRetryMongoRender(true);
getMongoDashboard();
}
I'm also attaching a screenshot as requested, although it does not contain a lot of information. The second line in the console output shows the error that I'm getting back from Mongo: "Failed to fetch". (After encountering this issue, I've implemented retrying logic. In the screenshot below, the chart has successfully rendered in the 2nd attempt)
Thank you @lukeobvio, the snippet looks correct. Could you just make sure that the token is available when the first render call is made (the failing call)? Also, would it be ok if you share the dashboardId for investigation purposes? A security note here that even with the dashboardId we can't access your dashboard. I'm asking as it would help to do a deeper search in the logs.
Hi @kristinamongo, the dashboardId used in the screenshot above is: 648894ca-8f6c-43b4-854a-61b48d5527a6. But we experienced this with multiple different dashboards. Regarding the token: our code loads the token upfront, when loading the page. So I could understand the token being the issue if loading the dashboard failed when first loading the page, but we've mainly seen this issue when first attempting to load a dashboard after the page has already loaded. Once the new information is put in, we actually see the mongo "small graph" loading icon on the screen for a couple of seconds before it errors with "failed to fetch"
Hi @lukeobvio, apologies for the delay of this response, however I have not been able to find the cause of the issue you are experiencing. :(
There is a slight chance it could have been fixed by a patch we released yesterday. Do you mind checking with version 3.2.1?
If it still fails to fetch, I would need a bit more help from your side to investigate this. If you could repro the issue with an unauthenticated dashboard that I can use for debugging and investigation, that would help a lot.
Closing this due to inactivity. Feel free to open a new issue if you can repro with an unauthenticated dashboard so we can investigate further.
Getting error "Failed to fetch" when rendering a dashboard (created with the createDashboard method from the ChartsEmbedSDK). This only happens sometimes, usually the first time dashboard.render() is invoke. We were able to get around this by trying a second time.
Steps to reproduce the behavior:
Desktop Info: