Release Build Issues

Posted by jts-law on 12-Dec-2017 17:37

Hello,

Has anybody successfully deployed a "Release" build?  The "Debug" version works correctly but when I load the "Release" build version, the landing page loads correctly but any module I try to open generates the following error:

Error: [$injector:unpr] Unknown provider: eProvider <- e
errors.angularjs.org/.../unpr
    at vendor.bundle.js:1
    at vendor.bundle.js:1
    at Object.r [as get] (vendor.bundle.js:1)
    at vendor.bundle.js:1
    at r (vendor.bundle.js:1)
    at i (vendor.bundle.js:1)
    at Object.a [as invoke] (vendor.bundle.js:1)
    at l (vendor.bundle.js:1)
    at vendor.bundle.js:1
    at vendor.bundle.js:1 "Possibly unhandled rejection: {}"
(anonymous) @ vendor.bundle.js:1
(anonymous) @ vendor.bundle.js:1
c @ vendor.bundle.js:1
$digest @ vendor.bundle.js:1
$apply @ vendor.bundle.js:1
(anonymous) @ vendor.bundle.js:1
i @ vendor.bundle.js:1
(anonymous) @ vendor.bundle.js:1
setTimeout (async)
l.defer @ vendor.bundle.js:1
o @ vendor.bundle.js:1
(anonymous) @ vendor.bundle.js:1
dispatch @ vendor.bundle.js:1
m.handle @ vendor.bundle.js:1

Also, this app is running on an IIS server in case that makes a difference.

Louis

Posted by Radoslav Kirilov on 15-Dec-2017 04:59

Hi Louis,

 The problem is caused by dependency injection and magnification of the code in release mode from the jtsNavigation.module.js file. You have :

var resolveTemplate = ($q, jtslibService, $state) => {

However the $q, jtslibService, $state are not injected in strict mode. So when the code for release is produced and it is minified and obfuscated the services names are replaced with shorter names. More info you can find here: https://scotch.io/tutorials/declaring-angularjs-modules-for-minification

To fix the problem you can add:

resolveTemplate.$inject = ['$q', 'jtslibService', '$state'];

Best,

Rado

All Replies

Posted by Radoslav Kirilov on 13-Dec-2017 01:28

Hi Louis,

The described issue is very strange and we have not encounterеd it so far. I tested the 2.0.1 version with all views and everything works as expected. Can you send us the meta of the app in order to generate release version and investigate the problem in our side.

Looking forward for your reply.

Best,

Rado

Posted by jts-law on 13-Dec-2017 07:45

Rado,

Just to make sure I get you what you need, you want just the "meta" folder and nothing from the "app" folder?  Who should I send this to?

Louis

Posted by Radoslav Kirilov on 13-Dec-2017 08:09

Hi Louis,

The meta and generated app folder will be great. You can send it directly to me.

I ask only for meta because I do not know if you have any sensitive data in the app as custom code. But having meta and  app folder will speed up investigation of the problem. 

Best,

Rado

Posted by Radoslav Kirilov on 15-Dec-2017 04:59

Hi Louis,

 The problem is caused by dependency injection and magnification of the code in release mode from the jtsNavigation.module.js file. You have :

var resolveTemplate = ($q, jtslibService, $state) => {

However the $q, jtslibService, $state are not injected in strict mode. So when the code for release is produced and it is minified and obfuscated the services names are replaced with shorter names. More info you can find here: https://scotch.io/tutorials/declaring-angularjs-modules-for-minification

To fix the problem you can add:

resolveTemplate.$inject = ['$q', 'jtslibService', '$state'];

Best,

Rado

Posted by jts-law on 15-Dec-2017 09:12

Thanks Rado, adding the $inject fixed my issue and the "release" build now works correctly.

Louis

This thread is closed