ExLibrisGroup/primo-explore-devenv

Having problems with uglify and browserify

Closed this issue · 17 comments

Hi
Since commit 4fb6a835, the custom JS building fails when executing gulp run whith option "--browserify".
Do you think it could be caused by gulp-uglify and the use of vinyl-source-stream ?
Would it be possible to use vinyl-transform instead like described here.

Many Thanks,
Julien

Hi Julien,

Could you elaborate on the failure? Is there an error message?

Jeff

Gupl tasks run well without error messages but the custom.js seems badly minified.
I've got perpetual loading when launching the primo nui localhost server.
In console log, i'v got :

Error: [$injector:modulerr] Failed to instantiate module e#328 due to:
Error: [$injector:modulerr] Failed to instantiate module viewCustom due to:
Error: [$injector:unpr] Unknown provider: e
http://errors.angularjs.org/1.6.3/$injector/unpr?p0=e
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:939
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:23584
    at r (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:22493)
    at i (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:22798)
    at Object.a [as invoke] (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:23019)
    at r (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21865)
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:22004
    at o (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:1519)
    at h (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21766)
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21950
http://errors.angularjs.org/1.6.3/$injector/modulerr?p0=viewCustom&p1=Error%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20e%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.3%2F%24injector%2Funpr%3Fp0%3De%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A939%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A23584%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22493)%0A%20%20%20%20at%20i%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22798)%0A%20%20%20%20at%20Object.a%20%5Bas%20invoke%5D%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A23019)%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21865)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22004%0A%20%20%20%20at%20o%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A1519)%0A%20%20%20%20at%20h%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21766)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21950
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:939
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:22210
    at o (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:1519)
    at h (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21766)
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21950
    at o (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:1519)
    at h (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21766)
    at fe (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:23781)
    at a (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:9548)
    at ut (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:9858)
http://errors.angularjs.org/1.6.3/$injector/modulerr?p0=e%23328&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20viewCustom%20due%20to%3A%0AError%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20e%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.3%2F%24injector%2Funpr%3Fp0%3De%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A939%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A23584%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22493)%0A%20%20%20%20at%20i%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22798)%0A%20%20%20%20at%20Object.a%20%5Bas%20invoke%5D%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A23019)%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21865)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22004%0A%20%20%20%20at%20o%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A1519)%0A%20%20%20%20at%20h%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21766)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21950%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.3%2F%24injector%2Fmodulerr%3Fp0%3DviewCustom%26p1%3DError%253A%2520%255B%2524injector%253Aunpr%255D%2520Unknown%2520provider%253A%2520e%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.6.3%252F%2524injector%252Funpr%253Fp0%253De%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A939%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A23584%250A%2520%2520%2520%2520at%2520r%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A22493)%250A%2520%2520%2520%2520at%2520i%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A22798)%250A%2520%2520%2520%2520at%2520Object.a%2520%255Bas%2520invoke%255D%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A23019)%250A%2520%2520%2520%2520at%2520r%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A21865)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A22004%250A%2520%2520%2520%2520at%2520o%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A1519)%250A%2520%2520%2520%2520at%2520h%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A21766)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A21950%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A939%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22210%0A%20%20%20%20at%20o%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A1519)%0A%20%20%20%20at%20h%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21766)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21950%0A%20%20%20%20at%20o%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A1519)%0A%20%20%20%20at%20h%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21766)%0A%20%20%20%20at%20fe%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A23781)%0A%20%20%20%20at%20a%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A9548)%0A%20%20%20%20at%20ut%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A9858)
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:939
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:23584
    at r (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:22493)
    at i (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:22798)
    at Object.a [as invoke] (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:23019)
    at r (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21865)
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:22004
    at o (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:1519)
    at h (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21766)
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21950
http://errors.angularjs.org/1.6.3/$injector/modulerr?p0=viewCustom&p1=Error%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20e%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.3%2F%24injector%2Funpr%3Fp0%3De%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A939%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A23584%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22493)%0A%20%20%20%20at%20i%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22798)%0A%20%20%20%20at%20Object.a%20%5Bas%20invoke%5D%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A23019)%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21865)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22004%0A%20%20%20%20at%20o%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A1519)%0A%20%20%20%20at%20h%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21766)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21950
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:939
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:22210
    at o (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:1519)
    at h (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21766)
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21950
    at o (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:1519)
    at h (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21766)
    at fe (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:23781)
    at a (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:9548)
    at ut (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:9858)
http://errors.angularjs.org/1.6.3/$injector/modulerr?p0=e%23328&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20viewCustom%20due%20to%3A%0AError%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20e%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.3%2F%24injector%2Funpr%3Fp0%3De%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A939%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A23584%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22493)%0A%20%20%20%20at%20i%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22798)%0A%20%20%20%20at%20Object.a%20%5Bas%20invoke%5D%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A23019)%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21865)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22004%0A%20%20%20%20at%20o%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A1519)%0A%20%20%20%20at%20h%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21766)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21950%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.3%2F%24injector%2Fmodulerr%3Fp0%3DviewCustom%26p1%3DError%253A%2520%255B%2524injector%253Aunpr%255D%2520Unknown%2520provider%253A%2520e%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.6.3%252F%2524injector%252Funpr%253Fp0%253De%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A939%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A23584%250A%2520%2520%2520%2520at%2520r%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A22493)%250A%2520%2520%2520%2520at%2520i%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A22798)%250A%2520%2520%2520%2520at%2520Object.a%2520%255Bas%2520invoke%255D%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A23019)%250A%2520%2520%2520%2520at%2520r%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A21865)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A22004%250A%2520%2520%2520%2520at%2520o%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A1519)%250A%2520%2520%2520%2520at%2520h%2520(http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A21766)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A8003%252Fprimo-explore%252Flib%252Fangular-403b1ebcbc.js%253A1%253A21950%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A939%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A22210%0A%20%20%20%20at%20o%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A1519)%0A%20%20%20%20at%20h%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21766)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21950%0A%20%20%20%20at%20o%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A1519)%0A%20%20%20%20at%20h%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A21766)%0A%20%20%20%20at%20fe%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A23781)%0A%20%20%20%20at%20a%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A9548)%0A%20%20%20%20at%20ut%20(http%3A%2F%2Flocalhost%3A8003%2Fprimo-explore%2Flib%2Fangular-403b1ebcbc.js%3A1%3A9858)
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:939
    at http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:22210
    at o (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:1519)
    at h (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:21766)
    at fe (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:23781)
    at a (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:9548)
    at ut (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:1:9858)
    at Object.n.bootstrap (http://localhost:8003/primo-explore/lib/bundle-f1d15d15dd.js:60:31281)
    at http://localhost:8003/primo-explore/lib/bundle-f1d15d15dd.js:25:11879
    at u (http://localhost:8003/primo-explore/lib/angular-403b1ebcbc.js:3:7181)

All works well on tag 1.0.2

Hmm... That seems a little familiar. What arguments are you passing to gulp create-package? What happens if you add --browserify and --view {YOUR_VID}?

For example: gulp create-package --browserify --view CENTRAL_PACKAGE

Jeff

Precisely, this issue occurs when i’m using —browrserify.
We are using browserify for builing dependances and loading modules.

Everything worked well unit gulp-uglify sas introduced in code :-(

If i comment out this line, it works but custom.js is not minified...

Thanks
Julien

Just to clarify, when you say that you're using --browserify are you referring to the run task or the create-package task?

^ The reason I ask the question above... Since commit f18425b, I've needed to include the --browserify argument in the create-package task in addtion to the run task.

Jeff

I'm referring to the run task.
I did not generate a package again because I am stuck on this issue :-(

Ah. I sorry about that. You mentioned that you were seeing this on localhost, but I missed that.

I'm having trouble reproducing this error. Is your custom view code available in a public repo?

Jeff

I will make available our repo on github tomorrow, there is surely something wrong in our code :-(

What I do not understand is that everything worked well until commit 4fb6a835
I've checkout to 2a5c328 and it's ok.

Thanks again
Julien

I added commit 4fb6a83, so I'm definitely interested to know if this change breaks someone's build.

Would you mind sending me a link to your repo when it's up? I'm not sure what's causing the error at this point, but I'd be happy to try reproducing it with your custom js files.

Jeff

Hello Jeff
I added our repo on github.
You will find here : https://github.com/jsicot/primo-explore-33UDR2
We use Sass and browserify.
Our primo frond-end is https://rechercher.bu.univ-rennes2.fr and the view id is 33UDR2_VU1
Thanks again,
Julien

Hi Julien,

That's very helpful. Thanks for posting it.

I noticed that there are several declarations in the code that utilize implicit annotations for dependency injection. Implicit annotation in generally discouraged in AngualrJS because it is not safe for minification (the dependency names get mangled).

Preferably, one wolud use either inline array annotation or $inject. For example, to apply the former, this:

angular.module('mainmenu', []).component('prmSearchBarAfter', {
	bindings: { parentCtrl: '<' },
	controller: function controller($scope, $http, $element, kohaitemsService) {
		this.$onInit = function () {
		};
	},
	templateUrl: 'custom/33UDR2_VU1/html/prmSearchBarAfter.html'
});

... would be changed to this:

angular.module('mainmenu', []).component('prmSearchBarAfter', {
	bindings: { parentCtrl: '<' },
	controller: ['$scope', '$http', '$element', 'kohaitemsService', function controller($scope, $http, $element, kohaitemsService) {
		this.$onInit = function () {
		};
	}],
	templateUrl: 'custom/33UDR2_VU1/html/prmSearchBarAfter.html'
});

Once the implicit annotations are removed, the build should not generate any errors.

If there's interest in some sort of --browerify-without-minification option, I would be willing to submit a PR, but I generally think that minification is desirable.

Jeff

Hi Jeff,
Thanks for your good advices.
I removed implicit annotations but issue was always present after a gulp run.
The solution I found is to disable the mangle option in uglify like (in buildCustomJs.js) :
.pipe(uglify({ mangle: false }))

Thanks again,
Julien

It looks like implicit annotations are still being used in various places in the project. For example, the $http service is being injected into run blocks with implicit annotations in the koha*.js files.

Disabling the mangle option is definitely a straightforward way to fix the problem. Doing so will increase the size of custom.js a bit, but perhaps it's an acceptable tradeoff. (In my case, disabling name mangling increases the final js file size by about 35%.)

Jeff

When using the new minify feature, we also got a similar error, which was perfectly fixed by using inline array notation for our customizations.

I propose this issue be closed since it seems like implicit annotations is definitely the culprit, as confirmed by OP.

gilax commented

As @etgrieco suggested, I'm closing this issue since it seems like an implicit annotations issue.