Issue running $ ionic build --prod

LOL, dude, do you know what was it? I can’t believe I lost 15 hours on this, seriously.

Apparently I can’t export default class, this was the entire ******* issue.

My steps:

Step 1

Create a new ionic project and make check whether $ ionic build --prod works.

It did work.

Step 2

Try to make the build fail.

I achieved that creating a service and trying to use it in app.component.ts

import { Injectable } from '@angular/core'

@Injectable()
export default class Service {
  constructor() {}
}

Step 3

Try to make the build pass.

Updated my service to do an export class Service instead of export default class Service

import { Injectable } from '@angular/core'

@Injectable()
export class Service {
  constructor() {}
}

It passed.

Conclusion

Both errors were solved by that.

1- app.component.ts -> Can't resolve all parameters for MyApp [...]
2- app.module.ts -> Unexpected value 'null' declared by the module 'AppModule in [...]

Thanks for your help @cherry

1 Like