x)
- [ ] new
- [x] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
yes
I have set "target": "es6", when i try to serve my application using below command
ng serve ---aot
It throws below error:

If i change target to "es2015" and try to run using below commands
ng serve --prod
ng serve --aot
it throws a same error.
When using "ng serve" with target es2015 and es6
And all commands are working fine with target as es5
Download sample- issueSample.zip
Run "npm i"
The give anyone command from below list:

"@angular-devkit/build-angular": "^0.800.2",
"@angular-devkit/build-optimizer": "^0.800.2",
"@angular/cli": "~8.0.0",
"@angular/compiler-cli": "~8.0.0",
Reported issue occurs only when i use services in providers like below:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { GridModule } from '@syncfusion/ej2-angular-grids';
// have to below service
import { PageService, SortService, FilterService, GroupService } from '@syncfusion/ej2-angular-grids';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
GridModule
],
providers: [PageService,
SortService,
FilterService,
GroupService],
bootstrap: [AppComponent]
})
export class AppModule { }
When i add service like below it doesn't throws error even service also not get injected.
https://github.com/angular/angular-cli/issues/4043#issuecomment-283055330
i have used above reference like below:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { GridModule } from '@syncfusion/ej2-angular-grids';
import { PageService, SortService, FilterService, GroupService } from '@syncfusion/ej2-angular-grids';
import { AppComponent } from './app.component';
const providers = [];
providers.push({ PageService });
providers.push({ SortService });
providers.push({ FilterService });
providers.push({ GroupService });
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
GridModule
],
providers: [providers],
bootstrap: [AppComponent]
})
export class AppModule { }
It wont throw error and also my service not injected.
@kumaresan-subramani, can you please provide a link with the most possible code to get that error?
Thanks.
Hi @alan-agius4 ,
Please find issue reproducing steps here:
Step1: download sample -
issueSample.zip
step2: Run below commands:
npm i
ng serve --prod
You will see an error,When you set"target" to "es5" it works fine.
Old Issue - https://github.com/angular/angular-cli/issues/14577#issue-450183303
HI @alan-agius4 ,
Due to this https://github.com/angular/angular-cli/issues/14577,
Description
TypeScript ClassExpression are not being treeshaken away.
Example codes:
let ChipList = class ChipList extends Component { constructor(options, element) { super(options, element); } }; __decorate$4([ Property([]) ], ChipList.prototype, "chips", void 0); ChipList = __decorate$4([ NotifyPropertyChanges ], ChipList);
Anything else relevant?
14263
Thanks in advance
I think I found the problem, I will land a PR soon.
Hi @alan-agius4 ,
Could you please update when the fix will be moved to npm, which will helpful for me to proceed further.
Please add release notes, if you have made any major changes related to tree-shaking which will be helpful for me to work at my end.
Release notes are located here: https://github.com/angular/angular-cli/releases
@alan-agius4 ,
is this fix got published?. if yes, please tell me @angular-devkit/build-optimizer version.
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._
Most helpful comment
I think I found the problem, I will land a PR soon.