Ionic: issue with prod building

流过昼夜 提交于 2019-12-11 17:19:46

问题


I have a VERY strange bug which I have absolutely no idea how to debug.

When building my ionic app and launching on my Android, it works just fine. But, when I add the --prod flag - which I do every time I want to show something to the customer - I have that angular error :

 main.5e301c2a6dc3a49ec613.js:1 ERROR Error: StaticInjectorError[t -> e]: 
  StaticInjectorError(Platform: core)[t -> e]: 
    NullInjectorError: No provider for e!
    at t.get (main.5e301c2a6dc3a49ec613.js:1)
    at main.5e301c2a6dc3a49ec613.js:1
    at t (main.5e301c2a6dc3a49ec613.js:1)
    at t.get (main.5e301c2a6dc3a49ec613.js:1)
    at main.5e301c2a6dc3a49ec613.js:1
    at t (main.5e301c2a6dc3a49ec613.js:1)
    at t.get (main.5e301c2a6dc3a49ec613.js:1)
    at oi (main.5e301c2a6dc3a49ec613.js:1)
    at t.get (main.5e301c2a6dc3a49ec613.js:1)
    at Qi (main.5e301c2a6dc3a49ec613.js:1)

And the app doesn't load at all. Not very helpfull - which is expected since it's --prod. I could very well rollback every change I made since the last time it worked, and check line by line... But it would take an awful amount of time, and also I really think there is a more logical way to get to it.

[EDIT] Ooookay, it's an issue with the deeplink plugin. If I remove

import {Deeplinks} from '@ionic-native/deeplinks/ngx';
private deeplinks: Deeplinks

from app.components.ts the error is gone. If I set it back the error is back.

[EDIT 2] I tried another plugin, https://ionicframework.com/docs/native/firebase-dynamic-links/ - same problem ! When building with --prod there is the same error !

来源:https://stackoverflow.com/questions/54936778/ionic-issue-with-prod-building

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!