Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app.module.ngfactory failing PRD build #8312

Closed
vbudilov opened this issue Sep 29, 2016 · 63 comments
Closed

app.module.ngfactory failing PRD build #8312

vbudilov opened this issue Sep 29, 2016 · 63 comments
Assignees
Labels
needs: reply the issue needs a response from the user

Comments

@vbudilov
Copy link

Short description of the problem:

Getting the following:

[13:28:27]  Error: Could not resolve entry (.tmp/app/main.prod.js)
    at /home/xx/dev/xx/xx/xxx-ionic/node_modules/rollup/dist/rollup.js:8602:28
    at process._tickCallback (internal/process/next_tick.js:103:7)

The AppModuleNgFactory cannot be resolved:

import {AppModuleNgFactory} from "./app.module.ngfactory";

So main.prd.ts doesn't compile and the whole build fails.

I've searched all over and couldn't find an appropriate fix for this issue.

What behavior are you expecting?

I can build the project and run it on android

Steps to reproduce:

  1. ionic run android
insert any relevant code between the above and below backticks

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Which Ionic Version? 1.x or 2.x
v2 RC.0

Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.2.0
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS
Node Version: v6.7.0

npm -v
3.10.8
node -v
v6.7.0

@jgw96
Copy link
Contributor

jgw96 commented Sep 29, 2016

Hello, thanks for opening an issue with us! Could you post a repo that I can use to reproduce this issue?

@jgw96 jgw96 added needs: reply the issue needs a response from the user v2 labels Sep 29, 2016
@vbudilov
Copy link
Author

I figured it out, but only after creating a completely new project and transferring the components, etc to it. Once I did that, I ran ionic run android and saw the following:

[14:52:21] ngc error: Error: Error at /home/vova/dev/ideas/xxx/xxxx-app/.tmp/pages/auth/auth.ngfactory.ts:3805:29: Supplied parameters do not match any signature of call target.

For some reason this particular log entry isn't showing up in my original project, so I'm assuming there's a parameter that I have to set to verbose (or something to that effect).

Either way, once that was fixed the build was fine.

Any idea what changed from the old version to the new in regards to logging messages?

@danbucholtz
Copy link
Contributor

Nothing that we know of. Glad you were able to get it resolved 😄

I'm going to close this issue.

Thanks,
Dan

@jorgedkoala
Copy link

Hello, i have the same issue, attached the error stack

[09:38:27]  Error: Could not resolve entry (.tmp/app/main.prod.js)
    at /Users/koala/Documents/angular/tfc-mobile/node_modules/rollup/dist/rollup.js:8602:28

[09:38:27]  sass started ...
[09:38:31]  sass finished in 4.43 s
[09:38:31]  minify started ...
[09:38:31]  cleancss started ...
[09:38:31]  uglifyjs started ...
[09:38:31]  Error: ENOENT: no such file or directory, open '/Users/koala/Documents/angular/tfc-mobile/www/build/main.js'
    at Error (native)
    at Object.fs.openSync (fs.js:634:18)
    at Object.fs.readFileSync (fs.js:502:33)
    at addFile (/Users/koala/Documents/angular/tfc-mobile/node_modules/uglify-js/tools/node.js:68:22)
    at /Users/koala/Documents/angular/tfc-mobile/node_modules/uglify-js/tools/node.js:79:17
    at Array.forEach (native)
    at Object.exports.minify (/Users/koala/Documents/angular/tfc-mobile/node_modules/uglify-js/tools/node.js:77:26)
    at runUglifyInternal (/Users/koala/Documents/angular/tfc-mobile/node_modules/@ionic/app-scripts/dist/uglifyjs.js:34:19)
    at runUglify (/Users/koala/Documents/angular/tfc-mobile/node_modules/@ionic/app-scripts/dist/uglifyjs.js:23:28)
    at Object.uglifyjs (/Users/koala/Documents/angular/tfc-mobile/node_modules/@ionic/app-scripts/dist/uglifyjs.js:9:12)

It works well if i run ionic serve, but got this error if i run ionic run android

any idea, thanks for the help.

@BiteMyBucket
Copy link

I have the exact same problem, so it seems this is a problem affecting a number of people.

@jorgedkoala
Copy link

jorgedkoala commented Oct 3, 2016

but if i compile with ionic serve and then run cordova run android --device
it works

2016-10-03 11:14 GMT+02:00 BiteMyBucket [email protected]:

I have the exact same problem, so it seems this is a problem affecting a
number of people.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#8312 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD8b-UFSTDMcK_HPx3A0yzHnbSh-Rsebks5qwMd5gaJpZM4KKRGx
.

@scottwittrock
Copy link

Hello, I'm getting a similar issue when trying to use ionic build as well as when I try to emulate it on ios. Using ionic serve works properly on my local environment.

[12:20:20] Error: Could not resolve entry (.tmp/app/main.prod.js)

@jasonwaters
Copy link

jasonwaters commented Oct 3, 2016

+1 I have the same issue as well

@mola10
Copy link

mola10 commented Oct 4, 2016

Me too

@wicketyCode
Copy link

I too can run ionic serve on my local browser but when trying to run on my android device am getting the same error:

[15:19:15] Error: Could not resolve entry (.tmp/app/main.prod.js)
at C:\Users\aberec\ionic_projects\VERSION2\CustomerOverviewMobile\node_modul
es\rollup\dist\rollup.js:8602:28
at runMicrotasksCallback (internal/process/next_tick.js:58:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:592:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

Please advise us on what to do?

@danbucholtz
Copy link
Contributor

Hello all,

Can you try installing the latest app scripts and see if that resolves your issue or provides a better error message?

npm install @ionic/app-scripts@latest

Thanks,
Dan

@bvx89
Copy link

bvx89 commented Oct 4, 2016

I tried the latest release of app-scripts (0.0.28), but I get the same error on prod builds. When checking in the .tmp-dir, I see that it does not contain any .js files (only .ts), so it's probably skipping the transpilation step from typescript to javascript.

EDIT:
I found out that I had installed app-scripts globally, which was the 0.0.23 version. When I ran npm run build with the newest 0.0.28, I got the following error:

[16:54:42] ngc failed: Unable to find Angular Compiler "ngc" command: null
[16:54:42] Error: Unable to find Angular Compiler "ngc" command: null

I guess these errors were omitted before.

@vbudilov
Copy link
Author

vbudilov commented Oct 4, 2016

For some reason some of the error messages are being omitted, so all you see is that the main.js file is missing. I had to start from a new project (migrating my code to it) in order to see what's actually failing. Basically, something is missing in the instructions on how to migrate your current project to RC0

@jorgedkoala
Copy link

updated the app-scripts, i also updated the node and npm versions, and got a diferent error, but still dont run. i got this message

Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build

this is the error compiling

[16:40:39]  ngc error: Compilation failed
[16:40:39]  ngc failed:  NGC encountered an error
[16:40:39]  Error: NGC encountered an error
    at ChildProcess.<anonymous> (/Users/koala/Documents/angular/tfc-mobile/node_modules/@ionic/app-scripts/dist/ngc.js:60:24)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Error running ionic app script "build": Error: NGC encountered an error

And here the ionic info

Cordova CLI: 6.3.0
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: Not installed
ios-sim version: 5.0.8 
OS: Mac OS X El Capitan
Node Version: v6.6.0
Xcode version: Xcode 7.1.1 Build version 7B1005 

@danbucholtz
Copy link
Contributor

@bvx89 and @vbudilov,

Are you running npm 3? We require npm 3 now. I believe that is was in the release notes and instructions but perhaps it slipped through the cracks. Can you run npm --version to verify?

@jorgedkoala,

Dang, that error message is not very helpful 😄 . Can you dig in and see if you can get something else from it? Do you have ${PROJECT_ROOT}/node_modules/@angular/compiler-cli in your project? ngc is pretty strict with processing templates and code, but it doesn't seem to even running in your case.

Thanks,
Dan

@jorgedkoala
Copy link

jorgedkoala commented Oct 4, 2016

Thanks Dan for the interest,
My npm version is 3.10.8
also ${PROJECT_ROOT}/node_modules/@angular/compiler-cli is in the project i'll look 4 more information

@kamicodaxe
Copy link

kamicodaxe commented Oct 4, 2016

I'm having exactly the same problem as above (when I run ionic build). I noticed that there is a missing module in the main.prod.ts file in the app dir... the AppModuleNgFactory class is imported in the main.prod.ts file but there is no app.module.ngfactory.ts file.
I use node v4.6.0 and nvm3.x.x on windows 10.

I tried to create one but really, I am new to all this and all I do fail. please help!!

@kamicodaxe
Copy link

If some one can create the constructor in that missing app.module.ngfactory.ts file then I think it might resolve this issue.

@bvx89
Copy link

bvx89 commented Oct 4, 2016

@danbucholtz Yes. I'm running Node v6.7.0 and NPM v3.10.8. I can see the ngc symlink-file inside ${PROJECT_ROOT}/node_modules/.bin/, but it's pointing to the path ../ngc/main.js. As there is no ngc folder inside node_modules, the script fails. Should the ngc symlink point to node_modules/@angular/compiler-cli or something else?

EDIT: Well, I'm not sure what caused the afforementioned problem, but after I deleted node_modules and ran npm install, the path of the ngc-file inside ${PROJECT_ROOT}/node_modules/.bin/ became correct.

By running npm run build I can finally see all my errors inside the project. Thanks for your help!

@danbucholtz
Copy link
Contributor

danbucholtz commented Oct 4, 2016

@kami-ruvice,

The ngfactory.ts file missing is because that file is never used until after ngc runs. I am not in love with the way this works (build error by default until ngc runs) but it is how Angular does it and recommends doing it. This main change in a future iteration as I know Angular is making some changes to the ngc process.

Can everyone make sure there package.json entry for @ionic/app-scripts is set to latest? We're iterating really fast there and releasing often. Can you blow away your node_modules and do a fresh npm install and see if everything is resolved?

Also try blowing away the .tmp directory.

Thanks,
Dan

@FanYeeChok
Copy link

Deleted .tmp
Deleted node_modules
Update package.json -> @ionic/app-scripts to ^0.0.28

  1. npm install
  2. ionic platform rm ios && ionic platform add ios && ionic build ios
[10:17:52]  ngc error: Compilation failed
[10:17:52]  ngc failed:  NGC encountered an error
[10:17:52]  Error: NGC encountered an error
    at ChildProcess.<anonymous> (/app/node_modules/@ionic/app-scripts/dist/ngc.js:60:24)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)
Error running ionic app script "build": Error: NGC encountered an error

ionic info

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v6.7.0
Xcode version: Xcode 8.0 Build version 8A218a 

Temporary using @jorgedkoala method to work around

ionic serve
cordova build ios

It's work !!!

@adamdbradley
Copy link
Contributor

It appears there are a couple of different issues that are similar, so things to check:

  • There's an src/app/main.prod.ts file
  • @angular/compiler-cli has been installed
  • The app can be compiled with the Ahead of Time compiler (maybe error reporting isn't working)

The Angular's Ahead of time (AoT) compiler is very strict and what passes for dev mode probably isn't passing for production mode. ionic serve is only in dev mode, but the build is production. We'll get the error reporting improved for this.

@FanYeeChok
Copy link

Double checked

  • That is src/app/main.prod.ts
  • That is node_modules/@angular/compiler-cli

Still hitting the same error while ionic build ios

[10:17:52]  ngc error: Compilation failed
[10:17:52]  ngc failed:  NGC encountered an error

But I notice src/app/main.prod.ts having the error
import { AppModuleNgFactory } from './app.module.ngfactory';

[ts] Cannot find module './app.module.ngfactory'.

How to solve this?

@jorgedkoala
Copy link

Hello SOLVED in my case, after updated the app-scripts i could find the error
[10:12:41] ngc error: Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 37:23 in the original .ts file), resolving symbol AppModule in /Users/koala/Documents/angular/tfc-mobile/.tmp/app/app.module.ts

Produced by how i was calling "My Fault" the TranslateStaticLoader of ng2-translate service.
Now (AoT) is compiling a running.
Thanks a lot for your help.

@bvx89
Copy link

bvx89 commented Oct 5, 2016

@FanYeeChok As stated by @danbucholtz, the ngfactory is part of the ngc compilation and it's normal that it's missing from the src/app directory.

@endriazizi
Copy link

endriazizi commented Oct 5, 2016

package.json:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "dependencies": {
    "@ionic/storage": "^1.0.3",
    "@types/moment": "^2.13.0",
     "@types/lodash": "4.14.36",
    "cordova-plugin-device": "^1.1.3",
    "ionic-angular": "^2.0.0-rc.0",
    "ionic-native": "^2.0.3",
    "ionicons": "^3.0.0",
    "ng2-cordova-oauth": "0.0.6"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^0.0.28",
    "@types/lodash": "4.14.36",
    "@types/moment": "2.13.0",
    "typescript": "^2.0.3"
  },
  "description": "VirginRevolution: An Ionic project",
  "cordovaPlugins": [
    "cordova-plugin-compat",
    "cordova-plugin-x-socialsharing",
    "pushwoosh-cordova-plugin",
    "cordova-plugin-network-information",
    "cordova-plugin-device@~1.1.2",
    "cordova-plugin-console@~1.0.3",
    "cordova-plugin-whitelist@~1.2.2",
    "cordova-plugin-statusbar@~2.1.3",
    "ionic-plugin-keyboard@~2.2.1",
    "cordova-plugin-splashscreen@~3.2.2",
    "cordova-plugin-secure-storage@~2.4.1",
    "cordova-plugin-inappbrowser@~1.4.0",
    "cordova-plugin-geolocation@~2.2.0",
    "[email protected]",
    "pushwoosh-cordova-plugin@~6.2.0",
    "cordova-plugin-camera",
    {
      "variables": {
        "APP_ID": "966508260075659",
        "APP_NAME:": "VirginRevolutionSocialLogin"
      },
      "locator": "cordova-plugin-facebook4",
      "id": "cordova-plugin-facebook4"
    }
  ],
  "cordovaPlatforms": [
    "android"
  ]
}

rollup.config.js :

var ngTemplate = require('../dist/plugins/ng-template').ngTemplate;
var nodeResolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
var globals = require('rollup-plugin-node-globals');
var builtins = require('rollup-plugin-node-builtins');
var json = require('rollup-plugin-json');


var cfg=  {


          include: [
               'node_modules/ng2-cordova-oauth/**',
            'node_modules/rxjs/**',
            'node_modules/lodash/**',
           'node_modules/moment/moment.min.js'

          ],
          namedExports: {
            'node_modules/ng2-cordova-oauth/core.js' : ['CordovaOauth', 'Facebook', 'Google'],
            'node_modules/moment/moment.js' : ['moment'],
           'node_modules/lodash/lodash.js' : ['_']

          }
        }

// https://github.com/rollup/rollup/wiki/JavaScript-API

var rollupConfig = {
  /**
   * entry: The bundle's starting point. This file will
   * be included, along with the minimum necessary code
   * from its dependencies
   */
  entry: './.tmp/app/main.dev.js',

  /**
   * sourceMap: If true, a separate sourcemap file will
   * be created.
   */
  sourceMap: true,

  /**
   * format: The format of the generated bundle
   */
  format: 'iife',

  /**
   * dest: the output filename for the bundle in the buildDir
   */
  dest: 'main.js',

  /**
   * plugins: Array of plugin objects, or a single plugin object.
   * See https://github.com/rollup/rollup/wiki/Plugins for more info.
   */
  plugins: [
    ngTemplate(),
    builtins(),
    commonjs(cfg),
    nodeResolve({
      module: true,
      jsnext: true,
      main: true,
      browser: true,
      extensions: ['.js']
    }),
    globals(),
    json()
  ]

};


if (process.env.IONIC_ENV == 'prod') {
  // production mode
  rollupConfig.entry = '.tmp/app/main.prod.js';
  rollupConfig.sourceMap = false;
}


module.exports = rollupConfig;

Your system information:

Cordova CLI: 6.3.1                                                                                                                 
Gulp version:  CLI version 3.9.1                                                                                                   
Gulp local:                                                                                                                        
Ionic Framework Version: 2.0.0-rc.0                                                                                                
Ionic CLI Version: 2.1.0                                                                                                           
Ionic App Lib Version: 2.1.0-beta.1                                                                                                
OS:                                                                                                                                
Node Version: v6.7.0                                                                                                               

I got this error :( any suggestion @adamdbradley @FanYeeChok

Error running ionic app script "build": Error: NGC encountered an error                                                                                                                                  



npm                                                                                                                                                                                                      
 ERR! Windows_NT 10.0.10586                                                                                                                                                                              
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\endriazizi\\AppData\\Ro                                                                                                                  
s" "run" "build"                                                                                                                                                                                         
npm ERR!                                                                                                                                                                                                 
node v6.7.0                                                                                                                                                                                              
npm ERR! npm  v3.10.6                                                                                                                                                                                    
npm ERR! code ELIFECYCLE                                                                                                                                                                                 
npm ERR! ionic-hello-world@ build: `ionic-app-scripts build`                                                                                                                                             
npm ERR! Exit status 1                                                                                                                                                                                   
npm ERR!                                                                                                                                                                                                 
npm ERR! Failed at the ionic-hello-world@ build script 'ionic-app-scripts build'.                                                                                                                        
npm ERR! Make sure you have the latest version of node.js and npm installed.                                                                                                                             
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,                                                                                                                    
npm ERR! not with npm itself.                                                                                                                                                                            
npm ERR! Tell the author that this fails on your system:                                                                                                                                                 
npm ERR!     ionic-app-scripts build                                                                                                                                                                     
npm ERR! You can get information on how to open an issue for this project with:                                                                                                                          
npm ERR!     npm bugs ionic-hello-world                                                                                                                                                                  
npm ERR! Or if that isn't available, you can get their info via:                                                                                                                                         
npm ERR!                                                                                                                                                                                                 
     npm owner ls ionic-hello-world                                                                                                                                                                      
npm ERR! There is likely additional logging output above.                                                                                                                                                



npm ERR! Please include the following file with any support request:                                                                                                                                     
npm ERR!     c:\Users\endriazizi\Desktop\newVirgin\VirginRevolution\npm-debug.log                                                                                                                        

Caught exception:                                                                                                                                                                                        
 undefined                                                                                                                                                                                               

Mind letting us know? https://github.com/driftyco/ionic-cli/issues                                                                                                                                       

@adirzoari
Copy link

@danbucholtz here is the link for the node_modules
https://ufile.io/8557
thanks u

@danbucholtz
Copy link
Contributor

@adirzoari,

Can you install the latest version of @ionic/app-scripts?

npm install @ionic/app-scripts@latest

@danbucholtz
Copy link
Contributor

@adirzoari,

node_modules looks good I guess. Can you try to track it down and give us more information?

Thanks,
Dan

@adirzoari
Copy link

@danbucholtz i just installed and the installed successful but i tried to run npm run build again and i got the same erros. i'm just stuck with it from morning, i thought to format my pc because i have many erros all the week i can't make my app because that.

@danbucholtz
Copy link
Contributor

@adirzoari,

If you run npm --version, what comes up? Are you running npm 3?

Thanks,
Dan

@adirzoari
Copy link

@danbucholtz yes npm 3.10.8 and node version v6.8.0

@adirzoari
Copy link

@danbucholtz i just deleted all my files of ionic,cordova,npm,nodejs and installed again.
the same problem, maybe to format the pc?

@Purus
Copy link
Contributor

Purus commented Oct 15, 2016

I am getting the same issue. Using latest npm, node versions and ionic app-scripts.

@rrubio
Copy link

rrubio commented Oct 17, 2016

+1

Emulator (ionic emulate ios) was working fine up until latest updates here http://blog.ionic.io/ionic-2-rc-weekend-updates

I have blown away node_modules + installed latest scripts. Environment (latest) npm 3+ and node 6+.

NOTE: ionic serve works fine. Up until suggested changes here i had been able to run it under xcode, now that's not working either :-(

Error message:

npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/Cellar/node/6.5.0/bin/node" "/usr/local/bin/npm" "run" "build" "--color"
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ build: ionic-app-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world@ build script 'ionic-app-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.

@danbucholtz
Copy link
Contributor

@rrubio, @Purus, @adirzoari,

Can you give us a sample repo (dumbed down, very simple project) and recreate the issue?

We are seeing reports of the ngc (the Angular compiler) pointing out bugs in people's code (it's extremely strict), but haven't really seen what you're describing.

Thanks,
Dan

@Purus
Copy link
Contributor

Purus commented Oct 17, 2016

My issue was resolved in the thrad
ionic-team/ionic-app-scripts#171

It was an issue from my code where i changed the App name.

Thanks,
R.Purusothaman

On Mon, Oct 17, 2016 at 8:11 PM, Dan Bucholtz [email protected]
wrote:

@rrubio https://github.com/rrubio, @Purus https://github.com/Purus,
@adirzoari https://github.com/adirzoari,

Can you give us a sample repo (dumbed down, very simple project) and
recreate the issue?

We are seeing reports of the ngc (the Angular compiler) pointing out bugs
in people's code (it's extremely strict), but haven't really seen what
you're describing.

Thanks,
Dan


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#8312 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABBx54u44mkie5dCahVr1JtkFyo2uFVkks5q04k1gaJpZM4KKRGx
.

@Aristona
Copy link

@danbucholtz It also points out bugs in node_modules folder for some reason. I had to revert the version to 0.0.30 to be able to work today.

Is there any chance to get some CLI options to disable certain features such as ionic serve --no-ngc to disable ngc?

@danbucholtz
Copy link
Contributor

@Aristona,

We will have a fix out for that shortly.

Thanks,
Dan

@rrubio
Copy link

rrubio commented Oct 18, 2016

@danbucholtz so that's frustrating... I've created a new app to replicate issues and it all works fine i.e. ionic emulate fires up fine. I have also added changes released over the weekend.

NOTE: dummy app was a basic start "ionic start testAPP tabs".. is this ok?

Totally stumped... Any suggestions?

@ryanemax
Copy link

Same ISSUE.
@adamdbradley thanks, we certainly need better reporting.

@ubaidazad
Copy link

getting error on running watch or serve on RC1

[14:32:36]  ionic-app-scripts 0.0.36
[14:32:36]  watch started ...
[14:32:36]  build dev started ...
[14:32:36]  clean started ...
[14:32:36]  clean finished in 11 ms
[14:32:36]  copy started ...
[14:32:36]  transpile started ...
[14:32:38]  lint started ...
[14:32:47]  lint finished in 9.04 s
[14:32:53]  typescript: ...odules/ionic-angular/components/action-sheet/action-sheet-component.ngfactory.ts,
            line: 123
            Supplied parameters do not match any signature of call target.

     L122:  this._el_3 = this.renderer.createElement(this._el_2,'div',(null as any));
     L123:  this.renderer.setElementAttribute(this._el_3,'class','action-sheet-group');
     L124:  this._anchor_4 = this.renderer.createTemplateAnchor(this._el_3,(null as any));

[14:32:53]  typescript: ...nda/src/node_modules/ionic-angular/components/alert/alert-component.ngfactory.ts,
            line: 135
            Supplied parameters do not match any signature of call target.

     L134:  this._anchor_3 = this.renderer.createTemplateAnchor(this._el_2,(null as any));
     L135:  this._appEl_3 = new import2.AppElement(3,2,this,this._anchor_3);
     L136:  this._TemplateRef_3_5 = new import19.TemplateRef_(this._appEl_3,viewFactory_AlertCm

[14:32:53]  typescript: ...src/node_modules/ionic-angular/components/loading/loading-component.ngfactory.ts,
            line: 88
            Supplied parameters do not match any signature of call target.

      L87:  this._TemplateRef_2_5 = new import17.TemplateRef_(this._appEl_2,viewFactory_Loading
      L88:  this._NgIf_2_6 = new import15.NgIf(this._appEl_2.vcRef,this._TemplateRef_2_5);
      L89:  this._anchor_3 = this.renderer.createTemplateAnchor(this._el_1,(null as any));

[14:32:53]  typescript: ...os/seller/panda/src/node_modules/ionic-angular/components/menu/menu.ngfactory.ts,
            line: 85
            Supplied parameters do not match any signature of call target.

      L84:  this.init(([] as any[]),[
      L85:    this._el_0,
      L86:    this._el_1

[14:32:53]  typescript: ...os/seller/panda/src/node_modules/ionic-angular/components/menu/menu.ngfactory.ts,
            line: 116
            Property 'bdClick' does not exist on type 'Menu'.

     L115:  if ((renderType_Menu === (null as any))) { (renderType_Menu = viewUtils.createRenderC
     L116:  return new _View_Menu0(viewUtils,parentInjector,declarationEl);

[14:32:53]  typescript: ...nda/src/node_modules/ionic-angular/components/modal/modal-component.ngfactory.ts,
            line: 50
            Property 'ngAfterViewInit' does not exist on type 'ModalCmp'.

      L49:    return (true && pd_0);
      L50:  }

[14:32:53]  typescript: ...nda/src/node_modules/ionic-angular/components/modal/modal-component.ngfactory.ts,
            line: 84
            Supplied parameters do not match any signature of call target.

      L83:  this._appEl_2 = new import2.AppElement(2,1,this,this._el_2);
      L84:  var disposable_0:Function = this.renderer.listen(this._el_0,'click',this.eventHandle
      L85:  this._expr_1 = import7.UNINITIALIZED;

[14:32:53]  typescript: ...a/src/node_modules/ionic-angular/components/picker/picker-component.ngfactory.ts,
            line: 50
            Supplied parameters do not match any signature of call target.

      L49:  this._expr_2 = import7.UNINITIALIZED;
      L50:  this.init(([] as any[]).concat([this._el_0]),[this._el_0],([] as any[]),([] as any[]
      L51:  return this._appEl_0;

[14:32:53]  typescript: ...a/src/node_modules/ionic-angular/components/picker/picker-component.ngfactory.ts,
            line: 442
            Supplied parameters do not match any signature of call target.

     L441:  this._el_5 = this.renderer.createElement(this._el_3,'div',(null as any));
     L442:  this.renderer.setElementAttribute(this._el_5,'class','picker-toolbar');
     L443:  this._text_6 = this.renderer.createText(this._el_5,'\n        ',(null as any));

[14:32:53]  typescript: ...a/src/node_modules/ionic-angular/components/picker/picker-component.ngfactory.ts,
            line: 679
            Supplied parameters do not match any signature of call target.

     L678:  this._expr_2 = import7.UNINITIALIZED;
     L679:  this._expr_3 = import7.UNINITIALIZED;
     L680:  this._expr_4 = import7.UNINITIALIZED;

[14:32:53]  typescript: ...src/node_modules/ionic-angular/components/popover/popover-component.ngfactory.ts,
            line: 51
            Property 'ngAfterViewInit' does not exist on type 'PopoverCmp'.

      L50:    return (true && pd_0);
      L51:  }

[14:32:53]  typescript: ...src/node_modules/ionic-angular/components/popover/popover-component.ngfactory.ts,
            line: 87
            Supplied parameters do not match any signature of call target.

      L86:  this._el_3 = this.renderer.createElement(this._el_1,'div',(null as any));
      L87:  this.renderer.setElementAttribute(this._el_3,'class','popover-content');
      L88:  this._el_4 = this.renderer.createElement(this._el_3,'div',(null as any));

[14:32:53]  typescript: .../seller/panda/src/node_modules/ionic-angular/components/range/range.ngfactory.ts,
            line: 212
            Supplied parameters do not match any signature of call target.

     L211:  this._expr_2 = import7.UNINITIALIZED;
     L212:  this.init(([] as any[]).concat([this._el_0]),[this._el_0],([] as any[]),([] as any[]
     L213:  return this._appEl_0;

[14:32:54]  typescript: ...panda/src/node_modules/ionic-angular/components/searchbar/searchbar.ngfactory.ts,
            line: 78
            Property 'shouldAlignLeft' does not exist on type 'Searchbar'.

      L77:  const currVal_4:any = this._Searchbar_0_4._sbHasFocus;
      L78:  if (import4.checkBinding(throwOnChange,this._expr_4,currVal_4)) {
      L79:    this.renderer.setElementClass(this._el_0,'searchbar-has-focus',currVal_4);

[14:32:54]  typescript: ...panda/src/node_modules/ionic-angular/components/searchbar/searchbar.ngfactory.ts,
            line: 89
            Property 'ngAfterViewChecked' does not exist on type 'Searchbar'.

      L88:    return new _View_Searchbar_Host0(viewUtils,parentInjector,declarationEl);
      L89:  }
      L90:  export const SearchbarNgFactory:import12.ComponentFactory<import3.Searchbar> = new impo

[14:32:54]  typescript: ...panda/src/node_modules/ionic-angular/components/searchbar/searchbar.ngfactory.ts,
            line: 219
            Property 'searchbarInput' does not exist on type 'Searchbar'.

     L218:  this.init(([] as any[]),[
     L219:    this._el_0,
     L220:    this._el_1,

[14:32:54]  typescript: ...eller/panda/src/node_modules/ionic-angular/components/toggle/toggle.ngfactory.ts,
            line: 42
            Supplied parameters do not match any signature of call target.

      L41:    return this._appEl_0;
      L42:  }
      L43:  injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {

[14:32:54]  transpile failed
[14:32:54]  copy finished in 17.59 s
[14:32:54]  watch ready in 17.97 s

using following ionic configurations.

Gulp version:  CLI version 1.2.2
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.36
OS:
Node Version: v6.9.1

@danbucholtz
Copy link
Contributor

@ubaidazad,

That looks like a legitimate compiler error. Can you try fixing the errors and try again?

Thanks,
Dan

@shahmonika
Copy link

@FanYeeChok try this in main.ts
import { AppModuleNgFactory } from '../aot/app/app.module.ngfactory';
then make its compile and then do rollup which in turn makes build

it worked for me

@ubaidazad
Copy link

@danbucholtz prod build is running well, getting errors only on watch and build on dev.

@queejie
Copy link

queejie commented Dec 8, 2016

I have the same problem: I receive the "Cannot find module './app.module.ngfactory'. " error when I run ionic build, but not when running the serve. I have updated the scripts, node, npm, etc. as recommended here. I have removed the node_modules, .tmp and www directories multiple times before rebuilding.

I am able to build the tutorial app. I believe the problem is in an external .js based node_module that I added, probably either ng2-charts or angular2-select. The biggest problem is that there is no real error message provided, so I don't know how to fix it. I have read elsewhere that the problem might be that a .manifest.json file needs to exist in the third party module. If so, what would that need to look like?

@vegardlarsen
Copy link

We just got this on our TeamCity build agents, but not on local machines. After quite a bit of debugging, it turned out the build agents had a newer version of TypeScript. Locking our version of TypeScript to version 2.0.9 solved the problem for us (both Android and iOS builds).

TLDR: npm install [email protected] --save-dev

@SwatiJadhav46
Copy link

@vegardlarsen Thanks. Solved My issue.

@danirb
Copy link

danirb commented Dec 12, 2016

@jorgedkoala Thanks! I solve change:
import { TranslateModule, TranslateLoader,TranslateStaticLoader } from 'ng2-translate/ng2-translate';
to
import { TranslateModule, TranslateLoader } from 'ng2-translate/ng2-translate';
import { TranslateStaticLoader } from 'ng2-translate';

@youssmak
Copy link

thanks @vegardlarsen you saved my night 👍

@calebswank11
Copy link

For anyone else stumbling upon this and the above not working, I got the error that main.dev.ts & main.prod.ts was deprecated and to create a main.ts file from the following link and delete the other two. Worked like a charm and ios build works. yet to try android.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 5, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: reply the issue needs a response from the user
Projects
None yet
Development

No branches or pull requests