bim360appstore-model.derivative-nodejs-xls.exporter icon indicating copy to clipboard operation
bim360appstore-model.derivative-nodejs-xls.exporter copied to clipboard

Cannot read property 'forEach' of undefined

Open Vovka66 opened this issue 7 years ago • 5 comments

when I try to Exptort, I get this err: ForgeXLS.js:189 Uncaught TypeError: Cannot read property 'forEach' of undefined at Object.getAllElementsOnCategory (ForgeXLS.js:189) at ForgeXLS.js:176 at Array.forEach () at Object.prepareRawData (ForgeXLS.js:174) at ForgeXLS.js:166 at Object.success (ForgeXLS.js:44) at i (jquery.min.js:2) at Object.fireWith [as resolveWith] (jquery.min.js:2) at A (jquery.min.js:4) at XMLHttpRequest. (jquery.min.js:4)

Vovka66 avatar Oct 25 '18 04:10 Vovka66

I also have the same issue. Could you fix it?

CristhianCarmona avatar Aug 12 '19 11:08 CristhianCarmona

this is probably happening for specific files, can you provide more info on the file you're using it?

augustogoncalves avatar Aug 12 '19 17:08 augustogoncalves

I use the version released here in the main page and deplyed on heroku. This is happening into ForgeXLS.js when trying to export to XLS pushing the button.

Downloading metadata... ForgeXLS.js:56 Downloading hierarchy... ForgeXLS.js:61 Downloading properties... ForgeXLS.js:191 Uncaught TypeError: Cannot read property 'forEach' of undefined at Object.getAllElementsOnCategory (ForgeXLS.js:191) at ForgeXLS.js:178 at Array.forEach () at Object.prepareRawData (ForgeXLS.js:176) at ForgeXLS.js:168 at Object.success (ForgeXLS.js:46) at u (jquery.min.js:2) at Object.fireWith [as resolveWith] (jquery.min.js:2) at k (jquery.min.js:2) at XMLHttpRequest. (jquery.min.js:2) getAllElementsOnCategory @ ForgeXLS.js:191 (anonymous) @ ForgeXLS.js:178 prepareRawData @ ForgeXLS.js:176 (anonymous) @ ForgeXLS.js:168 success @ ForgeXLS.js:46 u @ jquery.min.js:2 fireWith @ jquery.min.js:2 k @ jquery.min.js:2 (anonymous) @ jquery.min.js:2 load (async) send @ jquery.min.js:2 ajax @ jquery.min.js:2 forgeGetRequest @ ForgeXLS.js:32 getProperties @ ForgeXLS.js:62 (anonymous) @ ForgeXLS.js:167 success @ ForgeXLS.js:46 u @ jquery.min.js:2 fireWith @ jquery.min.js:2 k @ jquery.min.js:2 (anonymous) @ jquery.min.js:2 load (async) send @ jquery.min.js:2 ajax @ jquery.min.js:2 forgeGetRequest @ ForgeXLS.js:32 getHierarchy @ ForgeXLS.js:57 (anonymous) @ ForgeXLS.js:166 success @ ForgeXLS.js:46 u @ jquery.min.js:2 fireWith @ jquery.min.js:2 k @ jquery.min.js:2 (anonymous) @ jquery.min.js:2 load (async) send @ jquery.min.js:2 ajax @ jquery.min.js:2 forgeGetRequest @ ForgeXLS.js:32 getMetadata @ ForgeXLS.js:52 prepareTables @ ForgeXLS.js:159 downloadXLSX @ ForgeXLS.js:77 button1.onClick @ xlsextension.js:39 (anonymous) @ Button.js:32

It seems the variable category is empty hierarchy.data.objects[0].objects.forEach(function (category)

Just in case Google Chrome Versión 75.0.3770.142 (Build oficial) (64 bits)

CristhianCarmona avatar Aug 13 '19 06:08 CristhianCarmona

interesting, indeed we should have a check at that point, we're reviewing these sample, will fix it.

augustogoncalves avatar Aug 13 '19 22:08 augustogoncalves

Sounds good. I hope being soon ;)

CristhianCarmona avatar Aug 14 '19 08:08 CristhianCarmona