Ngc error: Compilation failed. Genymotion, ionic2, rc0

Hi all ! Can anyone suggest please !

Compilation fails during build process in genymotion whereas application loads fine on ionic serve.

[15:33:27] lint finished in 3.29 s
[15:33:45] ngc error: Error: Error at D:/tmp/ionic2/rc0MyApp/.tmp/app/app.modul
e.ngfactory.ts:419:107: Property ‘string’ does not exist on type ‘typeof “D:/tmp
/ionic2/rc0MyApp/.tmp/providers/user”’.
Error at D:/tmp/ionic2/rc0MyApp/.tmp/app/app.module.ngfactory.ts:419:140: Proper
ty ‘string’ does not exist on type ‘typeof “D:/tmp/ionic2/rc0MyApp/.tmp/provider
s/user”’.
Error at D:/tmp/ionic2/rc0MyApp/.tmp/app/app.module.ngfactory.ts:419:173: Proper
ty ‘string’ does not exist on type ‘typeof “D:/tmp/ionic2/rc0MyApp/.tmp/provider
s/user”’.
at check (D:\tmp\ionic2\rc0MyApp\node_modules@angular\tsc-wrapped\src\tsc.j
s:31:15)
at Tsc.typeCheck (D:\tmp\ionic2\rc0MyApp\node_modules@angular\tsc-wrapped\s
rc\tsc.js:86:9)
at D:\tmp\ionic2\rc0MyApp\node_modules@angular\tsc-wrapped\src\main.js:33:2
3
at process._tickCallback (internal/process/next_tick.js:103:7)
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

System information:

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
OS: Windows 7 SP1
Node Version: v6.7.0

I have the same problem you could solve?

Some thing similar but in android,
And everything works fine in browser and gets through ionic serve

I think I have the same kind of error. Any progress on someone side?

Personaly I found this : https://github.com/driftyco/ionic/issues/8312

i cleared them… all these are errors based on new angular2 and ionic rc0… Somehow these escapes ionic serve
but until all these are solved I was not able to run the app in device.

I solve my problem, just remove type string from constructor before parameters …

I finally solved it.

The problem is that the error from ionic are a little bit confusing, They are pointing at temporary files. But the issues are actually correct.
It looks like the ngc is looking at the html file when compiling, and since there is no checking (in my visual code) I couldn’t see some of the bad practices I had.

Mostly I had error when I was using directly a var in the html but didn’t declared it before in the ts file.
It happened also when I was using private var from my Component in the html. There should be public to do that

The ionic error messages could be a little bit clearer, that would help, but now it works like a charm :slight_smile:

yes, i come back to response this post, i too change remove all private in var and work!

Hi,

I’m getting a similar error:

[21:56:25]  ngc: Error: Error at D:/Users/User/Desktop/project/.tmp/app/app.module.ngfactory.ts:587:140: Property 'string' does not exist on type 'typeof "D:/Users/User/Desktop/project/.tmp/providers/firebase.service"'.
  at check (D:\Users\User\Desktop\project\node_modules\@angular\tsc-wrapped\src\tsc.js:31:15)
  at Tsc.typeCheck (D:\Users\User\Desktop\project\node_modules\@angular\tsc-wrapped\src\tsc.js:86:9)
  at D:\Users\User\User\project\node_modules\@angular\tsc-wrapped\src\main.js:33:23
  at process._tickCallback (internal/process/next_tick.js:103:7)
  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

Unfortunately, I cannot remove string from my constructor as I need it to extend the AngularFire class. Anyone know what the proper way to handle this error is?

From my experience I would says that the error come from a template html. Check if you don’t misuse your service there, where the typescript spell check can’t help you on an editor.

Thanks for your comment. This solves my problems too!

I my case this error comes from a provider file, which hence doesn’t have HTML template at all. The problematic parameter is defined as private and is never used outside the component:

constructor( parseServer: ParseServer, private name: string)

I tried to change string by any , but I’m still getting the same type of error:

Property 'any' does not exist on type 'typeof'

Any ideas?