Skip to content

YESTERDAY'S RELEASE : Lot of error when build AOT #5620

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

Closed
elvisbegovic opened this issue Mar 24, 2017 · 18 comments
Closed

YESTERDAY'S RELEASE : Lot of error when build AOT #5620

elvisbegovic opened this issue Mar 24, 2017 · 18 comments

Comments

@elvisbegovic
Copy link
Contributor

elvisbegovic commented Mar 24, 2017

After updating (existing project, on windows10) :
CLI from rc2 to v1.0.0
Angular from rc4 to v4.0.0
Typescript to 2.2.1

Before yesterday's release, I never get errors when building using --prod but today my projects doesn't compile cause of private/protected members used in template!!! WHAT A MESS

https://gist.github.com/istiti/5b8e8c9db15135681f605b98e5a8e4f1

Wonder why this never happends before? how can I now search/replace all private/protected members used in template to public !

it's maybe stupid enhancement but is it possible that cli convert all members to public when runnin ng build ? or add a command to overwrite these propertys to public directly in project?

N.B: relativly big project

cc @hansl @filipesilva @Brocco @IgorMinar

@elvisbegovic elvisbegovic changed the title Lot of error when build AOT YESTERDAY'S RELEASE : Lot of error when build AOT Mar 24, 2017
@alastair-todd
Copy link

+1 could someone please explain this behaviour?

  1. for html templates to access their parent component's properties, what accessor level should these properties be (private is the gut feeling, the html + component class make up the component, I shouldnt have to make them public)?
  2. why would the --prod flag change this behaviour?

@bogdvn
Copy link

bogdvn commented Mar 24, 2017

+1
Beside this errors:

[disabled]="OnDsNotSelected()"
error: Supplied parameters do not match any signature of call target.

OnDsNotSelected(): boolean {
return this.options.length == 0;
}

Why i get this ?

@stavn1
Copy link

stavn1 commented Mar 24, 2017

Is there a way to solve this error with angular 2.4?

@Thieus
Copy link

Thieus commented Mar 24, 2017

+1 Same error
Have you got a solution ?

ERROR in ....ngfactory.ts (696,41): Property 'clipPathId' does not exist on type 'BubbleChartComponent'.
ERROR in ....ngfactory.ts (207,35): Supplied parameters do not match any signature of call target.
ERROR in ....ngfactory.ts (642,48): Property 'onActivate' does not exist on type 'HeatMapComponent'.
ERROR in ....ngfactory.ts (646,48): Property 'onDeactivate' does not exist on type 'HeatMapComponent'.
ERROR in ....ngfactory.ts(342,44): Property 'labels' does not exist on type 'AdvancedPieChartComponent'.
ERROR in ....ngfactory.ts (300,67): Supplied parameters do not match any signature of call target.
ERROR in ....ngfactory.ts (131,7): Supplied parameters do not match any signature of call target.
ERROR in ....ngfactory.ts (870,44): Property '_selectedType' is private and only accessible within class 'SearchFormFlowDetailComponent'.
....ngfactory.ts (879,44): Property '_typesFlow' is private and only accessible within class 'SearchFormFlowDetailComponent'.

@hassanasad
Copy link

Could all these errors be related to TypeScript version 2.2.1 ?

@filipesilva
Copy link
Contributor

User opened issue without bothering to fill in issue template, no repro or anything!!! WHAT A MESS

@IgorMinar
Copy link
Contributor

@filipesilva please be nice. Your comment is in violation of our communication guidelines.

@istiti @Thieus @alastair-todd @bogdvn @hassanasad can one of you please open a new issue following the instructions in the issue template? We need all the info we can get to reproduce and confirm this issue before we can quickly fix it.

@alastair-todd
Copy link

Declare a private variable in a Component and access it in the html.

Then ng build with the --prod flag.

Nothing complicated but fairly major.

@sumitarora
Copy link
Contributor

Issue is being tracked on this one #5623
☝️ ☝️ ☝️

@netmikey
Copy link

If someone is looking to migrate a bigger codebase: I've created hacked together a small macOS script that patches your codebase to make the required fields and methods (those actually used in at least one template) public. Currently only tested (and probably only works) on macOS because of sed vs GNU-sed specifics.

https://gist.github.com/netmikey/cb29ac391953f2c67aa102b28fd4fe16

@pcgeng
Copy link

pcgeng commented Apr 7, 2017

I have resolved it with Angular 2.4.10, Angular-CLI 1.0.0-rc.2, and TypeScript 2.1.6

@wnabil
Copy link

wnabil commented Apr 9, 2017

+1 for 1.0.0 but i dont have it on 1.0.0-beta.23.3

@kblestarge
Copy link

@netmikey your script sounds like it has the potential to save me a lot of time, but it doesn't seem to be working for me.

Are there any other workarounds for this issue?

@oferns
Copy link

oferns commented Aug 20, 2017

I am getting this error with @angular/cli v1.3.1 / Typescript 2.4.2 / @angular/core v4.3.5 ng build works. ng build --prod throws lots of errors like
ERROR : Property 'providers' is private and only accessible
within class 'ProviderPickerComponent'.

Do we need to reopen this issue?

@wnabil
Copy link

wnabil commented Aug 21, 2017

@oferns There is a changes was made with the angular cli from while ago.
the main problem is some variables are used inside the html and they are private in the component class
just remove the private key and everything will work fine.
I know this may be a huge problem specially with a big project "i felt that pain actually with my project xD" but sadly there is no other way to fix this.

@oferns
Copy link

oferns commented Aug 21, 2017

@wnabil Thanks for the response. Basically, dont make private anything that the view/html needs to see? How come it doesnt fail in dev mode? thanks

@wnabil
Copy link

wnabil commented Aug 21, 2017

@oferns as i understand before they was taking about this error will appear only when building the aot or the prod. generally just keep your variables public if you are using them inside the html.
you can serve your application with angular-cli as prod and aot "for testing and to help you with fixing the errors only" by running:
ng serve --prod --aot.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests