Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sjl
Contributor
Contributor

Mashup - Second app: "TypeError: Cannot read property 'id' of undefined"

Hi All,

I have encountered an error when attempting to replicate the example of multiple(2) apps within a single mashup.

help.qlik.com/en-US/sense-developer/June2018/Subsystems/Dev-Hub/Content/Howtos/dev-hub-add-objects-f...

One visualization from each app has been inserted. When viewed using the dev-hub mashup editor "View" button the page shows both visualizations.

When inserting the URL into a browser outside of the dev-hub  (after clearing the browser cache) only one of the visualizations shows. "TypeError: Cannot read property 'id' of undefined" is produced.

Any help is appreciated.

QlikSense version June 2018.

 

<div class="flex-container">
	<div id="QV01" class="qvobject"></div>
	<div id="QV02" class="qvobject"></div>
	<div id="QV03" class="qvplaceholder"></div>
	<div id="QV04" class="qvplaceholder"></div>
	<div id="QV05" class="qvplaceholder"></div>
	<div id="QV06" class="qvplaceholder"></div>
</div>

  

	//open apps -- inserted here --
	var app = qlik.openApp('197068e3-8cbe-45ea-9950-5a86cad966ef', config); 
	var app1 = qlik.openApp('fe64ef23-ebcc-4d24-8f95-994f3234cbe8', config);
	
	//get objects -- inserted here --
	app1.getObject('QV02','f99a8ef5-b104-499d-9d41-1a6c3edc0b61');
	app.getObject('QV01','mMaemz');

Mashup Error.JPGMashup Dev-Hub.jpg

Regards

Stephen

2 Replies
rzenere_avvale
Partner - Specialist II
Partner - Specialist II

Hi Stephen,

are you using the same user to develop the mashup from Dev-Hub and to verify it from another browser?
Are the QS apps published on a stream available to such user(s)?

Regards,
Riccardo

sjl
Contributor
Contributor
Author

Hello Riccardo,

Many thanks for the reply.

Yes both apps are published apps, and the user is the same in dev-hub as outside of it. I do clear the browser cache to simulate what a real world user would experience.

Interestingly the error is intermittent.

I did wonder if it was a sequencing issue. In that the openApp was not completing in time for the getObject that follows? I understand the require.js calls are asynchronous(?).

I've seen some code in my internet searches utilizing promises. The example as used from the the Qlik site did not demonstrate this.

Regards

Stephen