angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

AOT seems to be enabled by default in beta.22 ?

Open ritz078 opened this issue 9 years ago • 57 comments

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.22 node: 6.6.0 os: darwin x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

run ng serve

The log given by the failure.

Normally this include a stack trace and some more information.

10% building modules 2/2 modules 0 active(node:14509) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): 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, resolving symbol AppModule in /Users/ritz078/projects/housing-assist/src/app/app.module.ts, resolving symbol AppModule in /Users/ritz078/projects/housing-assist/src/app/a 20% building modules 86/86 modules 

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

ritz078 avatar Dec 03 '16 15:12 ritz078

npm install [email protected] and npm install [email protected] -g just stay on .21 until the team fixes it!

born2net avatar Dec 14 '16 13:12 born2net

still open on beta.23?

andrelmp avatar Dec 16 '16 12:12 andrelmp

It looks like beta.23 is not yet published to npm.

I'll check if this works when new version will be avabile

kucharzyk avatar Dec 16 '16 13:12 kucharzyk

@kucharzyk yeah.. i tried to installl latest version via NPM install Git../tarball/master but i have got tons of errors, so this is propably not the correct way.. so we have to wait :-( i am waiting for that because ngrx/effects are greta, but they use decorators, and they are stripped down in current CLI versions.

montella1507 avatar Dec 17 '16 15:12 montella1507

looks like this is affecting hmr usage too, now it does full reload on lazy-loaded components...

antonybudianto7 avatar Dec 19 '16 10:12 antonybudianto7

@hansl have you already noticed problems with HMR on 22-1 and lazy routes ? or shall i create an issues with minimal repo?

montella1507 avatar Dec 19 '16 11:12 montella1507

Adding the static analysis/AoT related issue(s) to the "breaking changes" section in the changelog would probably save some people trouble.

jponeill avatar Dec 23 '16 14:12 jponeill

To be clear -- is this a bug as far as the team is concerned, or is this how the cli will be compiling from beta 22 onward?

That is to say:

  • An angular-cli project (and all of it's dependencies) must be AoT ready, even if the developer has no desire to use AoT compilation
  • The --aot flag now controls whether the project will be precompiled, but will not disable the checks for AoT-compliance

I'd like to upgrade because of the speed improvements that have been made, but my project relies on some 3rd party libs that aren't AoT-ready.

rosslavery avatar Jan 03 '17 19:01 rosslavery

@rosslavery Pretty much. We're always looking for feedback, and we are really aware of the vacuum right now for developing AOT-compatible libraries.

Give us the libraries that are not AOT compliant and we can contact them. We have a great developer relations team that can help those libraries move onto supporting AOT (every library developer I've met wants to, they just often don't know how or it isn't clear).

hansl avatar Jan 03 '17 19:01 hansl

AFAIK the issues are beyond just AOT, as just running static methods forRoot is causing issues. and for what its worth, I believe we should continue and support --aot false as some projects I am working on have already been released and rely on CLI.

born2net avatar Jan 03 '17 19:01 born2net

@born2net the issue that a lot of libs that have a forRoot method are having is that somewhere in that forRoot method they are doing something that isn't statically analyzable.

Not saying I don't agree, just pointing out the issue is not calling static methods on modules

deebloo avatar Jan 03 '17 19:01 deebloo

@deebloo that's what I thought, but I double checked and mine is failing even if my forRoot does nothing at all... I opened a bug and provided access to project to @hansl but no status yet regards

born2net avatar Jan 03 '17 19:01 born2net

material2 has a forRoot (and is currently buggy and cumbersome for AoT).

pauleveritt avatar Jan 04 '17 13:01 pauleveritt

I can confirm forRoot does not work...

born2net avatar Jan 04 '17 13:01 born2net

I can confirm that forRoot does work. Been using it in my lib and it works with no issues.

trevor-hackett avatar Jan 06 '17 04:01 trevor-hackett

Closing this as obsolete. We've been enforcing static analysis since Beta 22 now.

hansl avatar Mar 16 '17 19:03 hansl

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.