You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@elvirdolic i believe AoT compilation is a perquisite to declaring an 1.0 release. So while it is not there right now it will be there as we approach an official release of angular2
@elvirdolic just an fyi I have gotten an angular-cli build working with AOT compilation so it is possible to roll it yourself for now if you want to play around with it.
@deebloo please provide us the steps to make AOT on cli webpack
Reacted by elvirdolic, Gabriel Zink, Alfonso Andrés López Molina, Michał Stawicki, Razvan Mitre, Asad Sahi, Abbas Monfared, Charl, David Weitzman, Jek Bao CHOO and 3 more
> ng b 10% building modules 5/6 modules 1 active ...de_modules/css-loader/lib/css-base.jsentry.split is not a function
TypeError: entry.split is not a function
at Function.ModuleRoute.fromString (/Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/@ngtools/webpack/src/plugin.js:24:27)
at /Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/@ngtools/webpack/src/plugin.js:244:34
at Array.map (native)
at AotPlugin._processNgModule (/Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/@ngtools/webpack/src/plugin.js:243:14)
at /Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/@ngtools/webpack/src/plugin.js:217:39
ng build -prod --aot
> ng build -prod --aot 10% building modules 3/4 modules 1 active ...de_modules/css-loader/lib/css-base.jsentry.split is not a function
TypeError: entry.split is not a function
at Function.ModuleRoute.fromString (/Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/@ngtools/webpack/src/plugin.js:24:27)
at /Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/@ngtools/webpack/src/plugin.js:244:34
at Array.map (native)
at AotPlugin._processNgModule (/Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/@ngtools/webpack/src/plugin.js:243:14)
at /Users/Meligy/Code/github/Meligy/routing-angular-cli/node_modules/@ngtools/webpack/src/plugin.js:217:39
ng serve --aot
This one only hangs with the following output
> ng serve --aot
** NG Live Development Server is running on http://localhost:4200. ** 10% building modules 7/11 modules 4 active ...i/node_modules/webpack/hot/emitter.js(node:205 20% building modules 84/84 modules 0 active
Remarks
CLI Version
This is tested with angular-cli beta.21 on macOS Sierra with Node v6.9.1 and NPM 4.0.2.
Sample Details
This is the following relevant app-routing.module.ts file:
This is the same issue I am having and trying to work through. I am using beta 22-1 and the latest beta 23 @master but I cannot get lazy loading to work at all. I have been at this for hours... It does work in beta 21.
Hmm.. I am using beta.24 and after running ng build -prod --aot I see no errors, build is completed, but... there is no AoT! main.*.bundle.js still contains all HTML templates and vendor file also contains Compiler code... So actually works completely without any AoT, just like a usual JIT...
FYI, I just upgraded to angular-cli beta24 and Angular 2.4.0 on my test project https://github.com/ryzy/play-ng2-github/ and AoT seems to work perfectly fine. It loads in ~.5s compared to ~1.5s without AoT.
Reacted by Meligy, Ilya and sasha karpov
Reacted by Nwel, Gabriel Delépine, Seb, Ilya and Pankaj Parkar
@ryzy we had people request that we don't remove decorators. It is using AOT and the Angular compiler isn't included, but the decorators are still there. Working towards the real solution.
I often use AOT in my angular 2 app. But meanwhile I am facing the issue that as it gives the "Property 'staff_name' does not exist on type 'StaffRentListComponent' in my previous files history. Means it shows deleted code in ngfactory.ts (in AOT bundle folder) file and there is no code in my actual .ts file. Please let me know that how can I resolve this issue.
@prabh08 This is a topic for another issue. Even more, since it seems a support request, a better fit would be StackOverflow (or gitter, which great people are normally active))
@ryzy I tried downloading your github project for verifying AoT speed test. But somehow npm install doesnt work because of dependencies. Can you please let me know how do we verify Aot speed test? Do I need to replace platform-browser-dynamic with platform-browser in main.ts file?
It seems that with AOT compilation, especially with Angular CLI, there is no window at the build time. I ended up with an option to implement a separate Window Service, which returns a window instance, to operate with.
PS: Refering to the examples in the SO question above, you can directly implement the getWindow function inside the get property and make it static, i.e.:
Is the bs-config.aot.ts file now deprecated / not required for aot to work? It's not mentioned in the documentation, but other websites make a reference to it. Nor is it included in the angular-cli.
@Rolice I know that the bs-config.aot.ts file (if is does get used) has an "open": false property. Setting this to true would open a window at build time.
angular-automatic-lock-bot commented on Sep 7, 2019
Activity
deebloo commentedon Aug 17, 2016
@elvirdolic i believe AoT compilation is a perquisite to declaring an 1.0 release. So while it is not there right now it will be there as we approach an official release of angular2
filipesilva commentedon Aug 23, 2016
We definitely plan on having it, but I don't have a timeline to give. It's a big thing on our radar though.
deebloo commentedon Aug 28, 2016
@elvirdolic just an fyi I have gotten an angular-cli build working with AOT compilation so it is possible to roll it yourself for now if you want to play around with it.
aminebizid commentedon Aug 28, 2016
@deebloo please provide us the steps to make AOT on cli webpack
razvanmitre commentedon Sep 4, 2016
@deebloo it would be very useful to me too, and I am sure also to other people. Thanks!
monfa-red commentedon Sep 15, 2016
Any luck with AOT?
We're using Angular2 in production, is there a hack to make it work with angular-cli@1.0.0-beta.14?
elvirdolic commentedon Sep 15, 2016
This repo provides some hacks. Check it out
https://github.com/brandonroberts/router-cli-aot/blob/master/README.md
aminebizid commentedon Sep 18, 2016
@elvirdolic this is not webpack
23 remaining items
Meligy commentedon Nov 24, 2016
OK. I tried this in beta.21.
https://github.com/Meligy/routing-angular-cli/tree/master
Still having issues with AoT.
ng build --aot
ng build -prod --aot
ng serve --aot
This one only hangs with the following output
Remarks
CLI Version
This is tested with angular-cli beta.21 on macOS Sierra with Node v6.9.1 and NPM 4.0.2.
Sample Details
This is the following relevant
app-routing.module.tsfile:The AoT commands above only work when I comment the 2nd and 3rd routes, changing the definition of
routesto be:Note that this means that even loading other modules directly (not with lazy loading) is also not working with AoT, not just lazy loading.
Update
Coping @hansl because he was the last one I knew of working on this.
Epotignano commentedon Dec 15, 2016
@Meligy I'm having exactly the same issue here
jwuliger commentedon Dec 17, 2016
This is the same issue I am having and trying to work through. I am using beta 22-1 and the latest beta 23 @master but I cannot get lazy loading to work at all. I have been at this for hours... It does work in beta 21.
barinovos commentedon Dec 21, 2016
Hmm.. I am using beta.24 and after running
ng build -prod --aotI see no errors, build is completed, but... there is no AoT!main.*.bundle.jsstill contains all HTML templates andvendorfile also contains Compiler code... So actually works completely without any AoT, just like a usual JIT...ryzy commentedon Dec 21, 2016
FYI, I just upgraded to angular-cli beta24 and Angular 2.4.0 on my test project https://github.com/ryzy/play-ng2-github/ and AoT seems to work perfectly fine. It loads in ~.5s compared to ~1.5s without AoT.
hansl commentedon Dec 21, 2016
Closing this as obsolete. We've been supporting AOT for a while; bugs should have their own issues in GitHub from now on.
hansl commentedon Dec 21, 2016
@ryzy we had people request that we don't remove decorators. It is using AOT and the Angular compiler isn't included, but the decorators are still there. Working towards the real solution.
prabh08 commentedon Jan 27, 2017
I often use AOT in my angular 2 app. But meanwhile I am facing the issue that as it gives the "Property 'staff_name' does not exist on type 'StaffRentListComponent' in my previous files history. Means it shows deleted code in ngfactory.ts (in AOT bundle folder) file and there is no code in my actual .ts file. Please let me know that how can I resolve this issue.
ShadowManu commentedon Jan 27, 2017
@prabh08 This is a topic for another issue. Even more, since it seems a support request, a better fit would be StackOverflow (or gitter, which great people are normally active))
MasthanRao commentedon Feb 27, 2017
@ryzy I tried downloading your github project for verifying AoT speed test. But somehow npm install doesnt work because of dependencies. Can you please let me know how do we verify Aot speed test? Do I need to replace platform-browser-dynamic with platform-browser in main.ts file?
Rolice commentedon Mar 24, 2017
It seems that with AOT compilation, especially with Angular CLI, there is no window at the build time. I ended up with an option to implement a separate Window Service, which returns a window instance, to operate with.
Reference: http://stackoverflow.com/questions/34177221/angular2-how-to-inject-window-into-an-angular2-service
PS: Refering to the examples in the SO question above, you can directly implement the
getWindowfunction inside thegetproperty and make it static, i.e.:Davy-F commentedon Jun 16, 2017
Is the bs-config.aot.ts file now deprecated / not required for aot to work? It's not mentioned in the documentation, but other websites make a reference to it. Nor is it included in the angular-cli.
@Rolice I know that the bs-config.aot.ts file (if is does get used) has an
"open": falseproperty. Setting this to true would open a window at build time.angular-automatic-lock-bot commentedon Sep 7, 2019
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.