Home > Enterprise >  Error: Optimization error [scripts.[contenthash:20].js]: Error: Terser failed for unknown reason
Error: Optimization error [scripts.[contenthash:20].js]: Error: Terser failed for unknown reason

Time:10-28

i have this error where i build my angular app [1]: https://i.stack.imgur.com/pVVFA.png

CodePudding user response:

Can you paste the contents of your AuthService.ts

CodePudding user response:

I had the same error "Optimization error [scripts.[contenthash:20].js]: Error: Terser failed for unknown reason.". I Tryied to find some solution but didn't had success.

Someone knows whats is hapenning with this error?

MY ANGULAR VERSION:

Angular CLI: 14.1.0
Node: 14.17.6
Package Manager: npm 6.14.15
OS: win32 x64

Angular: 14.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1401.0
@angular-devkit/build-angular   14.1.0
@angular-devkit/core            14.1.0
@angular-devkit/schematics      14.1.0
@angular/cdk                    13.3.6
@angular/material               13.3.6
@schematics/angular             14.1.0
rxjs                            7.5.5
typescript                      4.6.4

MY ANGULAR PACKAGE.JSON:

{
  "name": "my-box-project",
  "version": "0.0.1",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^14.1.0",
    "@angular/cdk": "^13.3.6",
    "@angular/common": "^14.1.0",
    "@angular/compiler": "^14.1.0",
    "@angular/core": "^14.1.0",
    "@angular/forms": "^14.1.0",
    "@angular/localize": "^14.1.0",
    "@angular/material": "^13.3.6",
    "@angular/platform-browser": "^14.1.0",
    "@angular/platform-browser-dynamic": "^14.1.0",
    "@angular/router": "^14.1.0",
    "@ng-bootstrap/ng-bootstrap": "^12.1.1",
    "@ngrx/core": "^1.2.0",
    "@ngrx/effects": "^13.2.0",
    "@ngrx/store": "^13.2.0",
    "@popperjs/core": "^2.10.2",
    "bootstrap": "^5.1.3",
    "highcharts": "^10.2.1",
    "highcharts-angular": "^3.0.0",
    "linq-to-typescript": "^10.0.0",
    "ngx-mask": "^13.1.13",
    "rxjs": "~7.5.0",
    "terser": "5.15.1",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^14.1.0",
    "@angular/cli": "^14.1.0",
    "@angular/compiler-cli": "^14.1.0",
    "@types/jasmine": "~3.10.0",
    "@types/node": "^12.11.1",
    "jasmine-core": "~4.0.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.1.0",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "typescript": "~4.6.2"
  }
}
  • Related