Building my owa it works while in development. That is when I build and deploy using
npm run build:prod
npm run build:deploy
But when I try to deploy using the zip file that was generated build:prod, the app breaks with the following errors in console.
vendor.bundle.ecf4fb29795ff397f0cb.js:4 Error: [$injector:unpr] Unknown provider: eProvider <- e
http://errors.angularjs.org/1.6.6/$injector/unpr?p0=eProvider%20<-%20e
at vendor.bundle.ecf4fb29795ff397f0cb.js:2
at vendor.bundle.ecf4fb29795ff397f0cb.js:2
at Object.r [as get] (vendor.bundle.ecf4fb29795ff397f0cb.js:2)
at vendor.bundle.ecf4fb29795ff397f0cb.js:2
at r (vendor.bundle.ecf4fb29795ff397f0cb.js:2)
at i (vendor.bundle.ecf4fb29795ff397f0cb.js:2)
at Object.a [as invoke] (vendor.bundle.ecf4fb29795ff397f0cb.js:2)
at f.instance (vendor.bundle.ecf4fb29795ff397f0cb.js:3)
at p (vendor.bundle.ecf4fb29795ff397f0cb.js:3)
at a (vendor.bundle.ecf4fb29795ff397f0cb.js:3) “
”
Also I noticed that files generated when deployed using the deploy command are different from the files generated by the build command.
Hmm, that Unknown provider error definitely looks familiar, but if it seems different from OMRSJS-18, then we should probably go ahead and log another ticket.
Also I noticed that files generated when deployed using the deploy command are different from the files generated by the build command.
If I remember correctly, the prod build is uglified, so I expect there to be a difference. Unless you mean something else?
Yeah I think that is what is happening. I just thought maybe should point it out.
The build part is a blocker for me. I cannot continue development. While when using deployment works fine but I don’t know how to modify the deploy goal to include some other files I want. I’m using sw-precache module. And after installing the module, it generates a service worker file from the contents of the dist folder generated by the build goal. I don’t know how to make it generate this service worker for the deploy goal instead.
To generate my service worker file. I do
npm run build:prod
That will generate a dist folder. Now to generate a service worker from the contents of the dist folder, I have this in my script “sw”: “sw-precache --root=dist --config=sw-precache-config.js” so running
npm run sw
will add a service worker file in dist/service-worker.js. But this does not affect the deploy and I don’t even understand how the deploy creates it’s files so the app that is always deployed does not have this service-worker.js and I can’t use the version packaged with the build goal because of the error I posted earlier.
The deploying the /dist folder generated by the latter does not give those errors. I can use this until the prod build is fixed.
But since I’ll not be using the deploy. This will mean I won’t be getting live reloads. I’d have to redeploy on every change. Painful but I got no other choice.