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

AOT fails with type errors even when no type errors in the project #1536

Closed
csreddy opened this issue Oct 25, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@csreddy
Copy link

commented Oct 25, 2016

I have absolutely no type errors in my project, npm run build.prod builds without any issues. But npm run build.prod.exp fails with type errors
All the errors seem to be originating from *.ngfactory.ts files

Showing partial output

dist/tmp/app/app.component.ngfactory.ts(350,40): error TS2346: Supplied parameters do not match any signature of call target.
dist/tmp/app/app.module.ngfactory.ts(437,23): error TS2339: Property 'status' does not exist on type 'typeof "/Users/sreddy/space/angularjs/regression-status/dist/tmp/app/app.module"'.
dist/tmp/app/app.module.ngfactory.ts(438,25): error TS2339: Property 'platform' does not exist on type 'typeof "/Users/sreddy/space/angularjs/regression-status/dist/tmp/app/app.module"'.
dist/tmp/app/configure/configure.component.ngfactory.ts(1876,103): error TS2339: Property 'branches' does not exist on type 'Object'.
dist/tmp/app/configure/configure.component.ngfactory.ts(1931,104): error TS2339: Property 'areas' does not exist on type 'Object'.
dist/tmp/app/configure/configure.component.ngfactory.ts(1986,105): error TS2339: Property 'sandbox' does not exist on type 'Object'.
dist/tmp/app/configure/configure.component.ngfactory.ts(2041,105): error TS2339: Property 'performance' does not exist on type 'Object'.
dist/tmp/app/configure/configure.component.ngfactory.ts(2096,105): error TS2339: Property 'tags' does not exist on type 'Object'.
dist/tmp/app/configure/configure.component.ngfactory.ts(2862,132): error TS2339: Property 'broadcast' does not exist on type 'Object'.
dist/tmp/app/configure/configure.component.ngfactory.ts(2862,196): error TS2339: Property 'broadcast' does not exist on type 'Object'.
dist/tmp/app/login/login.component.ngfactory.ts(398,40): error TS2341: Property 'loginForm' is private and only accessible within class 'LoginComponent'.
dist/tmp/app/login/login.component.ngfactory.ts(523,43): error TS2341: Property 'loginForm' is private and only accessible within class 'LoginComponent'.
dist/tmp/app/platform/compare.component.ngfactory.ts(154,67): error TS2341: Property 'queryParams' is private and only accessible within class 'CompareComponent'.
...
...
...
lass 'StatusComponent'.
dist/tmp/app/status/status.component.ngfactory.ts(1392,43): error TS2341: Property 'diffDeltaSelectionOptions' is private and only accessible within class 'StatusComponent'.
dist/tmp/app/status/status.component.ngfactory.ts(1452,29): error TS2346: Supplied parameters do not match any signature of call target.
dist/tmp/app/status/status.component.ngfactory.ts(1500,72): error TS2346: Supplied parameters do not match any signature of call target.
@mgechev

This comment has been minimized.

Copy link
Owner

commented Oct 25, 2016

This is because tsc will run type checking in ngfactories which is something which doesn't happen runtime because the JiT compiler generates JavaScript instead of TypeScript. Fore more information you can take a look at the Angular issue tracker. Also, here are slides from a talk I gave about the compiler which might be helpful.

This is not an issue angular-seed but a problem that you have introduced. Make sure all your bindings have the correct types.

@mgechev mgechev closed this Oct 25, 2016

@kordianbruck

This comment has been minimized.

Copy link

commented Oct 25, 2016

@mgechev where is the correct location to place ones own typings?

@mgechev

This comment has been minimized.

Copy link
Owner

commented Oct 25, 2016

tools/manual_typings/project but this is not caused by lack of typings, I believe. More like semantic errors caused by accessing non existing properties of objects of specific type within the templates.

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