Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
SVAS
Contributor II
Contributor II

Mashup in React Native - error in requirejs

Hi all.

I created a react native app to test if it is possible to create a mashup in a mobile but I'm having troubles in loading the require.js file.

I'm getting the following error:

ERROR TypeError: Cannot read property 'documentMode' of undefined, js engine: hermes

This is an example of what I currently have:

 

const config = {
  host: "myHost.com", 
  prefix: "/",
  port: 443,
  isSecure: true,
  virtualProxy: "myVirtualProxy",
};

const baseUrl = `https://${config.host}:${config.port}/${config.virtualProxy}/resources`;

require.config({
  baseUrl: baseUrl
});

require(["js/qlik"], (qlik) => {
  qlik.on("error", (error) => console.error(error));
});

 

Is this correct or should I be doing it differently to surpass the issue? 

Thanks in advance.

Labels (3)
5 Replies
alex_colombo
Employee
Employee

Hi @SVAS it doesn't lool like an error from require.js. Please check:

  • Did you inject require.js script in your app (from html or from JS)?
  • Did you check if require.js is correctly loaded in developer tool network tab?

For a quick test, if you are using Qlik Sense enterprise, go to dev-hub and create a sample mashup, then you can inspect the code for checking if everything is setup correctly.

SVAS
Contributor II
Contributor II
Author

Hi @alex_colombo .

Thank you for your reply.

Yes, I am currently injecting the require.js script on my app.

I have created before an Angular mashup and my code works well on there, but the same doesn't happen with this new app in React Native for mobile. We are trying to create a mobile app but we are struggling to surpass this issue. 

Do you know if exists any documentation about mashups in mobiles?

Thanks in advance for your help.

alex_colombo
Employee
Employee

@SVAS there is no docs on mashup for mobile, mashup is a mashup, it's up to developers to make it responsive for mobile.

SVAS
Contributor II
Contributor II
Author

@alex_colombo I understand what you are saying but I'm not sure if you understood my question. I'm not trying to build a mashup that needs to be responsive in the browser or in a mobile. what i'm trying to do is to build a mobile App, like Whatsapp, using React Native and integrate with qlik like we do in a mashup. 

 

alex_colombo
Employee
Employee

@SVAS very sorry, I read React so my mind go straight to React JS. About React native, I don't know about any docs on this. What I can suggest is to check all the below steps:

  • Check if require.js is injected properly
  • Check if websocket connection is established between your app and Qlik engine
  • Check if you are correctly authenticated looking at websocket messages

Capability APIs and require.js use AngularJS, can React Native run this?

I suggest to try to use nebula.js instead.