AOT seems to be enabled by default in beta.22 ?
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 --versionand 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.
npm install [email protected]
and
npm install [email protected] -g
just stay on .21 until the team fixes it!
still open on beta.23?
It looks like beta.23 is not yet published to npm.
I'll check if this works when new version will be avabile
@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.
looks like this is affecting hmr usage too, now it does full reload on lazy-loaded components...
@hansl have you already noticed problems with HMR on 22-1 and lazy routes ? or shall i create an issues with minimal repo?
Adding the static analysis/AoT related issue(s) to the "breaking changes" section in the changelog would probably save some people trouble.
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
--aotflag 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 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).
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 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 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
material2 has a forRoot (and is currently buggy and cumbersome for AoT).
I can confirm forRoot does not work...
I can confirm that forRoot does work. Been using it in my lib and it works with no issues.
Closing this as obsolete. We've been enforcing static analysis since Beta 22 now.
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.