qlik-demo-team / qdt-components

React Components to be used with Angular 10, React 16 and Vue 2. Connects with the Capability API and Engine API.
MIT License
92 stars 50 forks source link

Need to append vp prefix to fetch require.js and qlik-styles.css #35

Closed miranda-elliott closed 5 years ago

miranda-elliott commented 5 years ago

I'm trying to use qdt-components in vue. I configured it as follows, per the vue template you all have published:

const options = {
  config: {
    host: '<host>',
    secure: true,
    port: 443,
    prefix: '<prefix>',
    appId: '<app-id>',
  },
  connections: {
    vizApi: true,
    engineApi: true,
  },
};

const qdtComponents = new QdtComponents(options.config, options.connections);

In simple tutorials for getting started with mashups, I learned to import require.js and qlik-styles.css into the HTML with an URL that includes the prefix of the virtual proxy. For example:

<script src="https://<host>/<prefix>/resources/assets/external/requirejs/require.js"></script>

If I understand this library correctly, you define the app configuration and it handles the rest. However, I can see that it's trying to fetch require.js and qlik-styles.css from the host without the prefix, so the request is returning a 301 and showing the following error in Firefox:

require.js:1 SyntaxError: expected expression, got '<'

Is this a known bug? How can I resolve this?

yianni-ververis commented 5 years ago

You do not need to load require.js in this one. It is something with the config. What is your prefix and your anon virtual proxy?

miranda-elliott commented 5 years ago

In VueComponent, the prefix is "/test/". In the QMC, the virtual proxy has the prefix "test". Why do you think it's trying to fetch those files without the prefix?

yianni-ververis commented 5 years ago

No you still need the prefix but without slashes

Sent from my iPhone


From: Miranda Elliott notifications@github.com Sent: Wednesday, August 22, 2018 9:10:31 AM To: qlik-demo-team/qdt-components Cc: Yianni Ververis; Comment Subject: Re: [qlik-demo-team/qdt-components] Need to append vp prefix to fetch require.js and qlik-styles.css (#35)

My prefix is "/test/". In the QMC, the virtual proxy has the prefix "test". Why do you think it's trying to fetch those files without the prefix?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/qlik-demo-team/qdt-components/issues/35#issuecomment-415026049, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMBqL3WHKo8_vIELHK5GJFBG62MRTCljks5uTVhHgaJpZM4WGiHe.

miranda-elliott commented 5 years ago

It's now fetching from the virtual proxy when I don't use slashes. Thank you!