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
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
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
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