Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Global of undefined - QS Extension creating session app #56

Closed
ClimberExtensions opened this issue May 19, 2017 · 3 comments
Closed

Comments

@ClimberExtensions
Copy link

Description

I'm trying to create a session app with enigma.js in a Qlik Sense extension. But when I call getService('qix',enigmaConfig) I get this error:
image
And if I step in to the code, this is where it happens:
image

Steps to Reproduce

enigma = '../.././external/qlik/enigma'
qixSchema = 'text!../.././external/qlik/qix/3.2/schema.json'
'ng!$q' = $q
'qlik' = qlik
app = qlik.currApp();

var enigmaConfig = {
Promise: $q,
appId: app.id,
schema: qixSchema,
session: {
host: $window.location.host,
secure: $window.location.protocol === 'https:'
}
};
enigma.getService('qix', enigmaConfig).then(function (qix) {
console.log('qix', qix);
});

Versions

  • Enigma.js: 1.1.1
  • Browser: Chrome 58.0.3029.110 (64-bit)
  • Qlik Sense: 3.2 SR2
  • Operating system: Windows 10
@marcusoffesson
Copy link
Contributor

marcusoffesson commented May 19, 2017

Hi @ClimberExtensions!

It looks like qixSchema is invalid. I notice you load it as text while enigma expect it to be an object structure. Can you see if the config below works?

var enigmaConfig = {
    Promise: $q,
    appId: app.id,
    schema: JSON.parser(qixSchema),
    session: {
        host: $window.location.host,
        secure: $window.location.protocol === 'https:'
    }
};

On a side note, if you intend to create a session app, appId is not needed (and should not be part of the config).

@kfsjostrand
Copy link

Thanks for the quick response , that solved the problem!

@peol
Copy link
Contributor

peol commented May 19, 2017

Awesome, thanks for responding :) Have a great weekend!

@peol peol closed this as completed May 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants