cancel
Showing results for 
Search instead for 
Did you mean: 

Error when using 3rd party dojo lib together with sap.viz

Former Member
0 Kudos

Hey guys,

I am facing a tricky situation that I need some help with. I am using the EsriJS API to visualize some data for a demo. So far so good.
Now I want to visualize some of the data on the map in a pie chart using the sap.viz.ui5.controls.VizFrame. Since EsriJS is using dojo and the sap.viz seems to be using dojo as well I am getting a defineAlreadyDefined error from the dojoLoader if I try to bootstrap UI5 before the esriJs. However, if I switch them, e.g. bootstrapping UI5 last, I am getting this error:

sap-ui-core-nojQuery.js:130 Uncaught Error: failed to load 'sap/viz/ui5/controls/VizFrame.js' from https://sapui5.hana.ondemand.com/resources/sap/viz/ui5/controls/VizFrame.js: Error: found in negative cache: 'sap/viz/library.js' from https://sapui5.hana.ondemand.com/resources/sap/viz/library.js: Error: failed to load 'sap/viz/libs/sap-viz-info-framework.js' from https://sapui5.hana.ondemand.com/resources/sap/viz/libs/sap-viz-info-framework.js: TypeError: require.config is not a function

Some more information: I am definitely adding the sap.viz in the bootstrap in my index.html page. I have also tried using the jQuery.sap.require functionality with a similar result.

Does anyone have any experience with using 2 libraries that use dojo or is it simply not possible / too complicated to be feasible? During my research I found this older post in the SCN (3724568) where Benjamin has had a similar problem. However since there was no answer, I thought I'd try to ask the question again in a different way.
Any help would be greatly appreciated.

Best regards
Matthias

Accepted Solutions (0)

Answers (2)

Answers (2)

GeorgeAbraham
Participant
0 Kudos

Any resolution to this?

former_member196805
Contributor
0 Kudos

Could you try load sap.viz library first in your bootstrap before loading the other libraries?

Former Member
0 Kudos

Hi Chapman,
thank you for your response. I've tried rearranging the libraries in the bootstrap, importing more / less, etc. Sadly there is no effect / change except for when I change the order of the bootstrap ( as described above).

former_member196805
Contributor
0 Kudos

I did not try but I have found this post from stackedOverflow: http://stackoverflow.com/questions/36407227/dojo-and-requirejs-error-definealreadydefined-when-using...

It seems there are conflict between dojo and requireJS.

Former Member
0 Kudos

Hi Chapman,


sorry for replying so late. I tried out the workaround from the stackoverflow post but it did not really do much. Also I am not quite sure if it would have the effect that I need, since I will need both the dojo and the requireJS in its full functionality and throwing away / overwriting 2 important methods will probably cause some more errors down the line (at least that's what I would expect but maybe I'm missing something).
Do you have any idea why I would get this kind of behavior though? Specially since I only get these errors if I try to import the viz Library. Everything else runs fine and works properly, so there must be something "special" in the viz library. Are you aware of anything in the viz library that would cause this?

junwu
Active Contributor
0 Kudos

there is a "define" function in viz, which probably caused the issue

Former Member
0 Kudos

The define function is in the other ui5 libraries like sap.m as well and they are working fine in my application, so it shouldn't be the problem, should it?
Right now I think that the 3rd party lib that the viz frame is using might cause the error, since it seems to be using some more jQuery functionalities that esri might use as well for their UI widgets and that could explain why I only get this error when I try to import the viz lib since it is the only one that uses these thirdparty tools.