Field 'browser' doesn't contain a valid alias configuration - on ionic build


#1

On running ionic cordova build android --prod --release I am getting the following error.Commands in dev mode are working fine without any issues.

Error: ./src/app/main.ts
Module not found: Error: Can’t resolve ‘./app.module.ngfactory’ in '/home/charlesskariah/wl/tug-frontend/src/app’
resolve ‘./app.module.ngfactory’ in '/home/charlesskariah/wl/tug-frontend/src/app’
using description file: /home/charlesskariah/wl/tug-frontend/package.json (relative path: ./src/app)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: /home/charlesskariah/wl/tug-frontend/package.json (relative path: ./src/app)
using description file: /home/charlesskariah/wl/tug-frontend/package.json (relative path: ./src/app/app.module.ngfactory)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
/home/charlesskariah/wl/tug-frontend/src/app/app.module.ngfactory doesn’t exist
.ts

cli packages: (/usr/lib/node_modules)

@ionic/cli-utils  : 1.17.0
ionic (Ionic CLI) : 3.17.0

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 3.1.0
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v8.2.1
npm               : 5.3.0 
OS                : Linux 4.4

Environment Variables:

ANDROID_HOME : /home/charlesskariah/Android/Sdk

Misc:

backend : pro

#2