What product/components do you use and which version/fix level are you on?
"@angular/animations": "~11.2.14",
"@angular/cdk": "~11.2.0",
"@angular/common": "~11.2.14",
"@angular/compiler": "~11.2.14",
"@angular/core": "~11.2.14",
"@angular/forms": "~11.2.14",
"@angular/platform-browser": "~11.2.14",
"@angular/platform-browser-dynamic": "~11.2.14",
"@angular/router": "~11.2.14",
"@c8y/cli": "^1011.47.0",
Is your question related to the free trial, or to a production (customer) instance?
trial
What are you trying to achieve? Please describe it in detail.
I’m trying to run a pure Angular project for Cumulocity as described on Cumulocity Web SDK Guide. I’m using Angular v11 lts which is stated in the guide is supported as of c8y version 10.10.4.0.
However, when I try to run it the below error appears. I have tried to fix it by changing the options in my angular.json as recommended in some forums. However this has only led to other errors. What might be the issue here? Could this be related to my Node version (currently an older version, v.12.11.1)? Any help would be appreciated.
Do you get any error messages? Please provide a full error message screenshot and log file.
Error:
An unhandled exception occurred: The 'buildOptimizer' option cannot be used without 'aot'.
Logfile:
[error] Error: The 'buildOptimizer' option cannot be used without 'aot'.
at generateWebpackConfig (C:\Users\wern\Documents\AngularProjects\test\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:16:15)
at generateBrowserWebpackConfigFromContext (C:\Users\wern\Documents\AngularProjects\test\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:136:26)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Object.generateI18nBrowserWebpackConfigFromContext (C:\Users\wern\Documents\AngularProjects\test\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:77:20)
at async setup (C:\Users\wern\Documents\AngularProjects\test\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:87:47)
angular.json:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"test": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@c8y/cli:build",
"options": {
"outputPath": "dist/test",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@c8y/cli:dev-server",
"options": {
"browserTarget": "test:build"
},
"configurations": {
"production": {
"browserTarget": "test:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "test:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "test:serve"
},
"configurations": {
"production": {
"devServerTarget": "test:serve:production"
}
}
}
}
}
},
"defaultProject": "test"
}