2 Replies Latest reply: Jul 26, 2017 10:24 AM by Alyssa Brouse RSS

    Struggling to bootstrap my mashup with a webpack module

    Alyssa Brouse

      I'm migrating my traditional requireJS Angular 1.x mashup to webpack, and struggling to bootstrap it to my module & qlik-angular after qlik has been loaded...

       

      var app = 'app';
      module.exports = app;
      var baseUrl = 'https://myhub:443/resources';
      require('script-loader!./require.js');
      window.require.config({baseUrl: baseUrl});
      window.require(['js/qlik'], function (qlik) {
        qlik.setOnError(function (error) {
          console.log('Qlik Instance error: [' + error.code + '] ' + error.message);
        });
        // globalQlikInstance = qlik;
        require('angular-ui-router');
        var routesConfig = require('./routes');
        var hello = require('./app/hello');
        angular
        .module(app, ['ui.router'])
        .config(routesConfig)
        .component('app', hello);
        angular.bootstrap(document, ['app', 'qlik-angular']);
      }, function (err) {
        console.log('Error loading qlik resources.' + err);
      });
      
      
      

       

      I receive an error: App already bootstrapped with this element 'document'

       

      Am I doing something horribly wrong here? I am admittedly new to webpack.