npm run ionic:build --prod giving strange error

后端 未结 3 825
生来不讨喜
生来不讨喜 2021-01-20 12:10

When I am trying to run npm run ionic:build --prod, it is giving me below errors:

Error: Cannot determine the module for class OverlayPor

相关标签:
3条回答
  • 2021-01-20 12:41

    I solve my problem. In my project I was using an outdated module, ion-datepicker. if you are also using same issue, here are some steps you can follow and find your infected or outdated module.

    1. Step one:

    In your project find in all files from 'ionic-angular/ word,

    2. Step two:

    If you find this word like import { xyz } from 'ionic-angular/xyz/abc'

    update that module.

    If no update available then you can remove that module

    npm uninstall ion-datepicker(or your defected module)
    

    After this you needs to remove that module from app.module.ts and where ever you are using remove from there, after that you can try

    ionic cordova build android --prod --release

    0 讨论(0)
  • 2021-01-20 12:44

    The file you are using to import is the type definitions file with the extension .d.js.

    You should import from the .ts file instead. Check the folder and you should get it

    0 讨论(0)
  • 2021-01-20 12:50

    I ran into this same error. For me it was due to inconsistent Ionic imports (some from top-level ionic-angular, and some importing directly from the component, e.g. ionic-angular/components/loading/loading-controller).

    https://stackoverflow.com/a/50858210/6599076

    0 讨论(0)
提交回复
热议问题