Need a special offer?Find out if your project fits.
+

Error - Cannot read property 'xa' of undefined

Answered
Marcelo Alejandro Gallardo asked on August 25, 2021

Good afternoon, I wanted to consult about a problem when ungrouping elements of a csv based on api server. From the server I could not catch any error but when loading it gives me the error "Cannot read property 'xa' of undefined". I do not see that information is missing but that error appears.
Could you guide me in that it could be thank you very much.

Attachments:
error.png

14 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster August 25, 2021

Hi Marcelo,
 
Could you please send us a dummy CSV data set with which the reported behavior is reproducible? This would make it a little easier for us to get to the core of the issue and resolve it faster.
 
Thank you in advance.
 
Best regards,
Mykhailo

Public
Marcelo Alejandro Gallardo August 25, 2021

Hi Mykhailo, I add the csv with which I tested and the example, the error is when I unzip the dates since I did not get the date hierarchy to work on the server so we had to add the year, month and day column to the csv.
When performing the expansion of the rows, it fails for the month field since it is not a hierarchy apparently
Error:Cannot read property 'xa' of undefined
https://jsfiddle.net/rw96o12v/ 

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster August 26, 2021

Marcelo,
 
Thank you for your swift response.
 
We were able to reproduce this behavior with the help of the CSV file you've sent: there seems to be an issue with how Flexmonster handles particular expands in combination with a Data Server-connected CSV file.
 
Our team will take a look at this, and we'll provide a fix with our upcoming release ETA Sep 20th.
 
As a side note, we've noticed that in your CSV file you're using dash prefixes (e.g., "-Unidades_Vendidas") in column headers – such prefixes only work when loading a CSV file directly into Flexmonster. When trying to do the same with Flexmonster Data Server, it simply parses a prefix as a part of the field name.
 
Please let us know if there is anything else we can help you with in the meantime.
 
Regards,
Mykhailo

Public
Marcelo Alejandro Gallardo August 26, 2021

Hi Mykhailo , if the prefix that the csv brings has it because before it was not used server but the server is in charge of removing them so it would not be a problem.
The downside is the aforementioned poster when ungrouping items. especially with the month column and not with the others. Without the grouped month field it works fine.
As I mentioned the problem is that the server does not allow the hierarchy of the date so we had to include those fields separately.
I hope you can assist me with this problem.
Regards, Marcelo
 

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster August 30, 2021

Hi Marcelo,
 
Thank you for the further explanation of your situation.
 
As promised, we are going to investigate this issue further and fix it in our upcoming release.
 
We'll keep you posted!
 
Regards,
Mykhailo

Public
Marcelo Alejandro Gallardo August 30, 2021

Hi Mykhailo, first of all thanks for taking care of the problem.

I found another problem when I double click on a field and it opens the detail, it gives me an error since it looks for a field that is calculated within the csv!
You can use the same example above to test!
The error is given to me when performing the PostSelect -> "The given key 'Average Price' was not present in the dictionary."
Regards, Marcelo

Public
Marcelo Alejandro Gallardo August 30, 2021

Hi, The second problem I solved it adding in the PostSelect of the server the following
if (query.Fields != null)
{
    for (int i = 0; i < query.Fields.Count; i++)
      {
        if (!nameTypes.ContainsKey(query.Fields[i].UniqueName))
         {
            query.Fields.RemoveAt(i);
          }
       }
}
so that it skips the columns that do not belong to the csv!
 
The problem with the month column that I consult persists, is there a way that it does not show the error poster until it is fixed? because the data is displayed well so it would not be a problem to show the data without that poster coming out!

Attachments:
given key solution.png

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster August 31, 2021

Marcelo,
 
Good to know the second issue has been resolved!
 
As a temporary workaround to avoid the error pop-up, you can use the queryerror event, which is triggered since the issue is happening during specific slice manipulations. For example:
 

flexmonster.on('queryerror', function() {
document.querySelector('.fm-ui-btn-dark').click();
});

 
The code above will immediately close the error pop-up so that the user does not have to deal with it.
 
Hope this helps!
 
Kind regards,
Mykhailo

Public
Marcelo Alejandro Gallardo August 31, 2021

Hi, I was able to hide the poster but the main problem is that when I ungroup until a month, it does not show me the corresponding info.
Attached image of the problem so that they can analyze it.
If I only show month or year it works fine since it does not have hierarchies!
It is a major problem since our users need these hierarchies for the analysis!
Thank you very much for the support

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster September 2, 2021

Marcelo,
 
Thank you for the follow-up!
 
The expanded cells being empty is a part of the issue with the console exception, which will be fixed on the previously provided ETA.
 
We'll let you know as soon as the fix is ready for download.
 
Best regards,
Mykhailo

Public
Marcelo Alejandro Gallardo September 20, 2021

Hello Mykhailo  how are you.
I update the version and it gives me the same error.
Could it be that something is still missing?
 
Thanks.

Attachments:
Error.png

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster September 21, 2021

Hi Marcelo,
 
Try clearing your browser's cache before loading the page with the updated Flexmonster instance – the old Flexmonster version script sometimes gets stuck in the cache, so clearing it often helps.
 
Also, make sure to update the Data Server itself, here's a reference on how to do that.
 
Please let us know if this helps.
 
Regards,
Mykhailo

Public
Marcelo Alejandro Gallardo September 23, 2021

Thank you very much, the problem was solved. I deleted all the libraries and then added them back!
Greetings

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster September 24, 2021

Marcelo,
 
Thank you for the confirmation, glad to hear the issue was resolved!
 
As always, feel free to reach out in case there is anything else we can help you with.
 
Best regards,
Mykhailo

Please login or Register to Submit Answer