# Cannot find main.js ios build

**URL:** <https://forum.ionicframework.com/t/cannot-find-main-js-ios-build/65259>\
**Category:** ionic-v3\
**Created:** [September 30, 2016, 7:36pm UTC](https://forum.ionicframework.com/t/cannot-find-main-js-ios-build/65259 "2016-09-30T19:36:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![srao2013](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@srao2013](https://forum.ionicframework.com/u/srao2013)\
**Post date:** [September 30, 2016, 7:36pm UTC](https://forum.ionicframework.com/t/cannot-find-main-js-ios-build/65259/1 "2016-09-30T19:36:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dimchar](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@dimchar](https://forum.ionicframework.com/u/dimchar)\
**Post date:** [September 30, 2016, 8:33pm UTC](https://forum.ionicframework.com/t/cannot-find-main-js-ios-build/65259/2 "2016-09-30T20:33:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![srao2013](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@srao2013](https://forum.ionicframework.com/u/srao2013)\
**Post date:** [September 30, 2016, 8:44pm UTC](https://forum.ionicframework.com/t/cannot-find-main-js-ios-build/65259/3 "2016-09-30T20:44:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dimchar](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@dimchar](https://forum.ionicframework.com/u/dimchar)\
**Post date:** [September 30, 2016, 8:50pm UTC](https://forum.ionicframework.com/t/cannot-find-main-js-ios-build/65259/4 "2016-09-30T20:50:05Z")

</div>

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

Have a look [here](https://forum.ionicframework.com/t/rc0-production-build-for-starter-projects-fails-serve-works-as-expected/65149)

---

<div class="post-metadata">

**Author:** ![srao2013](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@srao2013](https://forum.ionicframework.com/u/srao2013)\
**Post date:** [October 2, 2016, 5:09pm UTC](https://forum.ionicframework.com/t/cannot-find-main-js-ios-build/65259/5 "2016-10-02T17:09:18Z")

</div>

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

For further ref to [stackoverflow post](http://stackoverflow.com/questions/39378643/angular-2-ahead-of-time-compiler-must-i-make-all-class-properties-public) or [this](https://forum.ionicframework.com/t/rc0-typescript-private-vs-public-keyword/64863/20)

Thank you all for looking into it.
