{"action":"opened","issue":{"url":"https://api.github.com/repos/mgechev/angular2-seed/issues/1148","repository_url":"https://api.github.com/repos/mgechev/angular2-seed","labels_url":"https://api.github.com/repos/mgechev/angular2-seed/issues/1148/labels{/name}","comments_url":"https://api.github.com/repos/mgechev/angular2-seed/issues/1148/comments","events_url":"https://api.github.com/repos/mgechev/angular2-seed/issues/1148/events","html_url":"https://github.com/mgechev/angular2-seed/issues/1148","id":166932252,"number":1148,"title":"Prod build issues / Uncaught TypeError: System.register is not a function","user":{"login":"davidj-docker","id":15619344,"avatar_url":"https://avatars.githubusercontent.com/u/15619344?v=3","gravatar_id":"","url":"https://api.github.com/users/davidj-docker","html_url":"https://github.com/davidj-docker","followers_url":"https://api.github.com/users/davidj-docker/followers","following_url":"https://api.github.com/users/davidj-docker/following{/other_user}","gists_url":"https://api.github.com/users/davidj-docker/gists{/gist_id}","starred_url":"https://api.github.com/users/davidj-docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidj-docker/subscriptions","organizations_url":"https://api.github.com/users/davidj-docker/orgs","repos_url":"https://api.github.com/users/davidj-docker/repos","events_url":"https://api.github.com/users/davidj-docker/events{/privacy}","received_events_url":"https://api.github.com/users/davidj-docker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-21T22:27:46Z","updated_at":"2016-07-21T22:27:46Z","closed_at":null,"body":"When I build my project to production, there are no build errors. However I am seeing some issues, possibly with dependency injection.\r\n\r\nHere is my project.config.ts:\r\n\r\n```\r\nthis.NPM_DEPENDENCIES = [\r\n      ...this.NPM_DEPENDENCIES,\r\n      {src: 'jquery/dist/jquery.min.js', inject: true},\r\n      {src: 'bootstrap/dist/css/bootstrap.min.css', inject: true},\r\n      {src: 'bootstrap/dist/js/bootstrap.min.js', inject: true},\r\n      {src: 'font-awesome/css/font-awesome.min.css', inject: true},\r\n      {src: 'simple-line-icons/css/simple-line-icons.css', inject: true},\r\n      {src: 'ng2-bs3-modal/bundles/ng2-bs3-modal.js', inject: true},\r\n      {src: 'moment/min/moment-with-locales.min.js', inject: true},\r\n    ];\r\n\r\n    // Add `local` third-party libraries to be injected/bundled.\r\n    this.APP_ASSETS = [\r\n      ...this.APP_ASSETS,\r\n      { src: `${this.ASSETS_SRC}/plugins/slimScroll/jquery.slimscroll.min.js`, inject: true, vendor: true },\r\n       { src: `${this.ASSETS_SRC}/plugins/tagEditor/jquery.tag-editor.css`, inject: true, vendor: true  },\r\n       { src: `${this.ASSETS_SRC}/plugins/tagEditor/jquery.caret.min.js`, inject: true, vendor: true  },\r\n       { src: `${this.ASSETS_SRC}/plugins/tagEditor/jquery.tag-editor.min.js`, inject: true, vendor: true },\r\n       { src: `${this.ASSETS_SRC}/plugins/twbsPagination/jquery.twbsPagination.min.js`, inject: true, vendor: true  },\r\n       { src: `${this.ASSETS_SRC}/plugins/ionRangeSlider/css/ion.rangeSlider.css`, inject: true, vendor: true  },\r\n       { src: `${this.ASSETS_SRC}/plugins/ionRangeSlider/css/ion.rangeSlider.skinNice.css`, inject: true, vendor: true },\r\n       { src: `${this.ASSETS_SRC}/plugins/ionRangeSlider/js/ion.rangeSlider.min.js`, inject: true, vendor: true  },\r\n       { src: `${this.ASSETS_SRC}/css/AdminLTE.min.css`, inject: true, vendor: true },\r\n       { src: `${this.ASSETS_SRC}/css/skins/skin-blue.min.css`, inject: true, vendor: true },\r\n       { src: `${this.ASSETS_SRC}/js/app.js`, inject: true, vendor: true },\r\n    ];\r\n```\r\n\r\nThese assets in development mode are being properly injected into their respective sections:  <!-- inject:js --> & <!-- inject:css -->. However in production mode, these sections look like:\r\n\r\n```\r\n<!-- inject:css -->\r\n  <link rel=\"stylesheet\" href=\"css/main.css?1469139406071\">\r\n  <!-- endinject -->\r\n\r\n  <!-- shims:js -->\r\n  <!-- endinject -->\r\n\r\n  <!-- libs:js -->\r\n  <!-- endinject -->\r\n\r\n  <!-- inject:js -->\r\n  <script src=\"js/shims.js?1469139406067\"></script>\r\n  <script src=\"js/app.js?1469139406068\"></script>\r\n  <!-- endinject -->\r\n```\r\n\r\nI get this console output:\r\n\r\n```\r\nUncaught TypeError: System.register is not a function\r\nEXCEPTION: TypeError: $(...).twbsPagination is not a function\r\nEXCEPTION: TypeError: $(...).twbsPagination is not a function\r\nSTACKTRACE:\r\nTypeError: $(...).twbsPagination is not a function\r\n    at SafeSubscriber._dataService.getPage.subscribe._this._errorMessage [as _next] (app.js?1469138840680:35)\r\n    at SafeSubscriber.__tryOrUnsub (app.js?1469138840680:61)\r\n    at SafeSubscriber.next (app.js?1469138840680:61)\r\n    at Subscriber._next (app.js?1469138840680:61)\r\n    at Subscriber.next (app.js?1469138840680:61)\r\n    at CatchSubscriber.Subscriber._next (app.js?1469138840680:61)\r\n    at CatchSubscriber.Subscriber.next (app.js?1469138840680:61)\r\n    at TimeoutSubscriber._next (app.js?1469138840680:30)\r\n    at TimeoutSubscriber.Subscriber.next (app.js?1469138840680:61)\r\n    at MapSubscriber._next (app.js?1469138840680:60)\r\nUncaught TypeError: $(...).twbsPagination is not a function\r\n```\r\n\r\nThis is referring to my code that uses jQuery & the twbsPagination plugin:\r\n\r\n```\r\ndeclare var $: any;\r\n...\r\n@ViewChild('pagination') pagination: any;\r\n...\r\n$(this.pagination.nativeElement).twbsPagination({\r\n                initiateStartPageClick: false,\r\n                totalPages: this._listData.totalPages,\r\n                visiblePages: 14,\r\n                onPageClick: function (event: any, page: number) {\r\n                  if (page !== _self._currentPage) {\r\n                    _self.changePage(page);\r\n                  }\r\n                }\r\n              });\r\n...\r\n```\r\n\r\nAny help figuring out what the problem is would be appreciated."}}
{"actor":{"display_login":"davidj-docker"}}