Flexmonster React showing error when loading report

Answered
Patrick Berens asked on April 13, 2024

Hello Support,

We are trying to generate a report in local development (Production is working in AWS, as is our Developer cloud in AWS), but we are getting an error. It seems to be happening when we attempt to pass in an object to flexmonster. Flexmonster works when we pass in a link to that prop, but not when we define the object in the code.

Flexmonster Version: "flexmonster": "2.9.43",

Using Chrome Browser on osX.

We have a perpetual license. It is generated on the backend.

Note: We are running local dev on a "real" domain, not localhost or an ip. We are routing it locally with a hosts file.

React Minimal Example (normally we use more complicated props):

The following WORKS.

 render() {
return (
<div>
<FlexmonsterReact.Pivot
licenseKey={flexKey}
report="https://cdn.flexmonster.com/reports/report.json"
/>
</div>
)
}

However, if we take that exact report from that link, store it in a const object and send it into FlexmonsterReact.Pivot, it shows an error in a popup. Here is the error it shows in the popup:

TypeError
Cannot read properties of null (reading 'He')
Call Stack
a.Mfa
vendors-node_modules_react-flexmonster_build_index_js.chunk.js:2372:197
f.ff
vendors-node_modules_react-flexmonster_build_index_js.chunk.js:2370:438
f.HDa
vendors-node_modules_react-flexmonster_build_index_js.chunk.js:830:234
a.CK
vendors-node_modules_react-flexmonster_build_index_js.chunk.js:2370:411
undefined
vendors-node_modules_react-flexmonster_build_index_js.chunk.js:2365:287

The image called error_popup.png shows the error popup. The image spreadsheet_showing.png shows that report and data did in fact load in the background after you click "Close" on the error popup.

Here is a minimal example that also fails (Note: every object we've tried seems to fail, only links to reports succeed):

render() {
const tempReport2 = {
dataSource: {
data: [
{
businessUnit: 'Main',
},
{
businessUnit: 'Blah',
},
],
},
options: {
grid: {
type: 'flat',
showGrandTotals: 'off',
},
},
}
return (
<div>
<FlexmonsterReact.Pivot
licenseKey={flexKey}
report={tempReport2}
/>
</div>
)
}

Again this product is working in AWS Production and AWS Development environments. It has been for many years, not sure what is wrong in local dev environment. We have confirmed this is happening to multiple developers, not just one.

Thank you,
Patrick

3 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster April 15, 2024

Hello Patrick,

Thank you for reaching out to us.

We could not reproduce the described behavior on our side. Our team noticed that the issue occurred on the client side, although the changes were only made to the server side. We recommend checking for any Flexmonster configuration changes when porting the service from AWS to Azure.

If the error persists, could you please provide us with the link or sample project where this error occurs? It would greatly help us to debug the issue on our side.

Looking forward to hearing from you.

Kind regards,
Nadia

Public
Patrick Berens April 15, 2024

We haven't modified anything for Azure for the FE or BE. We've tested this on Github master branch locally and it fails. Master is what is currently deployed to AWS Dev and Production. The same code works in Dev/Production, but not locally.

We've also used a static version of a report on the FE, as mentioned above. So the report isn't even coming down from backend. We've used our own reports, and also static reports that your teams have produced (see below) which has allowed us to isolate the FE from the BE.

It works when we provide a URL for the report like this:

report="https://cdn.flexmonster.com/reports/report.json"

It doesn't work if we store that exact report as an object in javascript and try to load it (see tempReport2 example in initial post).

Why would it work with the link but not with a static object? Is there something different in how these are processed?

It will take some effort to produce a minimal example in a shared repo, we've had to move on from this as this project has many other tasks, but we can put it on our backlog.

Thanks,
Patrick

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster April 16, 2024

Hello Patrick,
Thank you for the quick response and providing us with the details.
There should be no difference in setting the report from the static object or the link. Since we haven't managed to reproduce the described behavior on our side, it would be great if you could provide us with an example where the issue is reproducible. This way, our developers would inspect and debug the issue to find the reason for such a behavior.
We look forward to hearing from you.
Kind regards,
Nadia

Please login or Register to Submit Answer