Error building app on ionic pro but works fine on dev machine


#1

Hi,

My build is failing on ionic pro but using ionic serve works without problem.

It throws an error on the transpile of the typescript files saying it cannot find a module that is on the same folder that the file that imports it.

From the logs I have this:

[20:26:51] transpile started …
[20:26:54] typescript: src/models/PlaceSearchModel.ts, line: 1
Cannot find module ‘./Municipality’.

   L1:  import { Municipality } from './Municipality';

[20:26:54] ionic-app-script task: “build”
[20:26:54] Error: Failed to transpile program
Error: Failed to transpile program
at new BuildError (/usr/src/app/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at /usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:137:20
at Promise ()
at transpileWorker (/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:103:12)
at Object.transpile (/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:61:12)
at buildProject (/usr/src/app/node_modules/@ionic/app-scripts/dist/build.js:97:78)
at /usr/src/app/node_modules/@ionic/app-scripts/dist/build.js:47:16


#2

What is your local ionic info output?


#3

cli packages: (C:\Users\RL\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3 browser 4.1.0 ios 4.4.0
Ionic Framework    : ionic-angular 3.6.0

System:

Android SDK Tools : 26.0.2
Node              : v6.11.2
npm               : 3.10.10
OS                : Windows 10

Environment Variables:

ANDROID_HOME : C:\Users\RL\AppData\Local\Android\sdk

Misc:

backend : pro