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

Ngc error: Compilation failed, ionic2, rc0 #8511

Closed
klochko7 opened this issue Oct 5, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@klochko7
Copy link

commented Oct 5, 2016

Hi all ! Can anyone suggest please !

Compilation fails during build process 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/nexttick.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

import {Injectable} from '@angular/core';

@Injectable()
export class User {
username:string;
password:string;
device:string;
active:number;

constructor(username:string, password:string, device: string) {
this.username = username;
this.password = password;
this.device = device;
this.active = 1;
}

}

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

@jigsaxis

This comment has been minimized.

Copy link

commented Oct 5, 2016

I have also same issue... in IONIC2 RC0

Error at H:/MyAppIO2RC0/MyApp/.tmp/pages/account/editaddress.ngfactory.ts:1881:74: Property 'firstname' does not exist on type 'any[]'.
Error at H:/MyAppIO2RC0/MyApp/.tmp/pages/account/editaddress.ngfactory.ts:1910:49: Property 'lastname' does not exist on type 'any[]'.

@danbucholtz

This comment has been minimized.

Copy link
Contributor

commented Oct 5, 2016

Those are issues in your app's source code. Fix the issue the error is referencing and you should be good to go.

I'm going to close this since this isn't an Ionic issue.

Thanks,
Dan

@danbucholtz danbucholtz closed this Oct 5, 2016

@epetre

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2016

Even if it is an issue with their source code, how are they supposed to debug with without the line number and with such a generic error : [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"'. .

Also, they can't reproduce with ionic serve, so that makes it even harder to debug and I am pretty sure it didn't happen before rc0.

I am wondering why those errors don't show up earlier in the process and we have to look at transpiled code to figure them out.

@danbucholtz

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2016

@epetre,

ionic serve does not run ngc. ionic run or ionic build do. You could also run npm run build if you wanted as well.

We are working on providing better error messages and Angular is too. The error message does provide a line number. app.module.ngfactory.ts is code generated by ngc, so take a look at that file on line 419, column 107 as the error message shows. It is saying the typeof operation is having an issue with the user class or something.

Thanks,
Dan

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.