ionic3 if use ionic cordova build is ok! but use ionic cordova build --prod Field 'browser' doesn't contain a valid alias configuration
+1
I have the same error here. It seems that ng cli, which ionic use for AoT, is not reporting errors correctly.
I tried running ./node_modules/.bin/ngc
to find out the correct errors in my project. After solving all errors , ionic cordova build --prod
works for me with no errors.
Adding more info about the project would be helpful.
Hello! While we appreciate you opening an issue with us I am going to close this issue and ask that you open a new one that has the issue template filled out, please.
Also providing a sample application via GitHub is always super helpful in duplicating and testing these issues.
Thanks for using Ionic!
Had the same issue, did what GuoLunHao suggested - worked a charm.
Run ./node_modules/.bin/ngc
to find out the correct errors.
Solve all errors.
Try ionic cordova build --prod
again
after I run ./node_modules/.bin/ngc , where do I look for the errors? My IDE is showing a bunch of new files generated, but no errors or warnings in the console
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Most helpful comment
I have the same error here. It seems that ng cli, which ionic use for AoT, is not reporting errors correctly.
I tried running
./node_modules/.bin/ngc
to find out the correct errors in my project. After solving all errors ,ionic cordova build --prod
works for me with no errors.