If I add the GridModule then do 'ng build --prod' I get.
ERROR in main.xxx.bundle.js from UglifyJs
TypeError: str.replace is not a function
npm install --save @progress/kendo-angular-grid @progress/kendo-angular-dropdowns @progress/kendo-angular-inputs @progress/kendo-angular-dateinputs @progress/kendo-data-query @progress/kendo-angular-intl @progress/kendo-angular-l10n @progress/kendo-drawing @progress/kendo-angular-excel-export @angular/animations
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { GridModule } from '@progress/kendo-angular-grid';
import { AppComponent } from './app.component';
@NgModule({
bootstrap: [AppComponent],
declarations: [AppComponent],
imports: [BrowserModule, BrowserAnimationsModule, GridModule]
})
export class AppModule {
}
You get a build error.
ERROR in main.xxxxxx.bundle.js from UglifyJs
TypeError: str.replace is not a function
Package versions:
"@angular/animations": "^5.2.0",
"@angular/common": "^5.1.0",
"@angular/compiler": "^5.1.0",
"@angular/core": "^5.1.0",
"@angular/forms": "^5.1.0",
"@angular/http": "^5.1.0",
"@angular/platform-browser": "^5.1.0",
"@angular/platform-browser-dynamic": "^5.1.0",
"@angular/router": "^5.1.0",
"@progress/kendo-angular-dateinputs": "^1.4.3",
"@progress/kendo-angular-dropdowns": "^1.6.0",
"@progress/kendo-angular-excel-export": "^1.0.5",
"@progress/kendo-angular-grid": "^1.7.1",
"@progress/kendo-angular-inputs": "^1.4.2",
"@progress/kendo-angular-intl": "^1.3.0",
"@progress/kendo-angular-l10n": "^1.0.5",
"@progress/kendo-data-query": "^1.1.2",
"@progress/kendo-drawing": "^1.4.1",
"core-js": "^2.4.1",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
System:
Angular CLI: 1.6.4
Node: 8.9.4
OS: win32 x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.6.4
@angular-devkit/build-optimizer: 0.0.38
@angular-devkit/core: 0.0.25
@angular-devkit/schematics: 0.0.48
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.4
@schematics/angular: 0.1.13
@schematics/schematics: 0.0.13
typescript: 2.5.3
webpack: 3.10.0
BTW 'ng build --prod' works fine if you remove GridModule from app.module.ts
It seems like a @angular/cli uglify-es npm package issue. https://github.com/angular/angular-cli/issues/9218
Pinning "uglify-es" to "3.3.5" fixes the issue.
I've got mine locked to 3.3.5 and I'm still getting this for the grid component
I had to delete my node_modules folder and package-lock.json and then npm install again to get the correct dependencies.
Yay, Thanks all.
Just to confirm I had to do all of the following to get this to work.
ng build --prod then worked.
This is probably a Angular-cli / Uglify issue rather than Kendo Grid... but Kendo GridModule was the only module in my package.json that made it surface.
Thanks again
We have applied a workaround for the error in the package for which it was thrown - telerik/kendo-intl. Updating the package should also resolve the problem.
@danielkaradachki I see this same error issue using @progress packages. Is there an update for those as well?
Which packages? The error would be thrown for packages that have dependency to progress/kendo-angular-intl which has dependency to telerik/kendo-intl.
Never mind. I updated all my packages again and now ng build is working properly.
Most helpful comment
I had to delete my node_modules folder and package-lock.json and then npm install again to get the correct dependencies.