Cannot find main.js ios build

Hey Guys,

I updated my ionic2 app from beta.11 to rc.0. When I do ionic serve works fine on the browser. When I do a ios build and deploy to actual device, I see the app launches the splash screen and then shows white screen. I debugged with the safari debugger and I don’t see main.js.

When I do ionic build ios I see the following error

Error: ENOENT: no such file or director /users/blah/repo/app/www/build/main.js

Here is my system config.

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0-beta.3
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.7.0
Xcode version: Xcode 8.0 Build version 8A218a

Appreciate for all your awesome work.

Thanks,
Srini

Don’t you get any other Error before that line?

I noticed that even an error occurs somewhere, the build process won’t exit and as a result you will get the impression that the process completed “successfully”. Later, when you run the application at the mobile, you realise that the main.js file is missing.

You are right.

I got the below error.

[16:38:01] bundle prod started …
[16:38:01] Error: Could not resolve entry (.tmp/app/main.prod.js)
at /users/blah/repo/app/node_modules/rollup/dist/rollup.js:8602:28

My main.prod.ts file looks like this

import { platformBrowser } from ‘@angular/platform-browser’;
import { enableProdMode } from ‘@angular/core’;

import { AppModuleNgFactory } from ‘./app.module.ngfactory’;

enableProdMode();
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);

I see a ts compiler error for app.module.ngfactory, not sure what I am missing

I setup my app.module following https://github.com/driftyco/ionic-conference-app/blob/master/src/app/app.module.ts. If I copy the main.js generated at ionic serve into ios build it works.

Appreciate any help.

it seems like you have the same issue as the one described in a different topic.

Have a look here

The issue seems to Ahead-of-Time compilation. After changing the private variables to public it started working.

For further ref to stackoverflow post or this

Thank you all for looking into it.