Only initialized variables and constants can be referenced in decorators
lsrsilva opened this issue · 2 comments
lsrsilva commented
I'm updating a project to angular 9 and when I run the command to extract I'm getting the error:
I'm not understanding why I'm getting this, because the app build occurs normally, and only with the extraction that the error occurs.
I'm using the version 1.4.0 of the library.
So, anyone else has faced the same error?
Adm project config on angular.json
"adm": {
"i18n": {
"sourceLocale": {
"code": "pt",
"baseHref": "/pt/"
},
"locales": {
"es": {
"translation": "projects/adm/i18n/messages.es.xlf",
"baseHref": "/es/"
},
"en": {
"translation": "projects/adm/i18n/messages.en.xlf",
"baseHref": "/en/"
}
}
},
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss",
"prefix": "adm"
}
},
"root": "projects/adm",
"sourceRoot": "projects/adm/src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/adm/pt",
"index": "projects/adm/src/index.html",
"main": "projects/adm/src/main.ts",
"polyfills": "projects/adm/src/polyfills.ts",
"tsConfig": "projects/adm/tsconfig.app.json",
"aot": true,
"localize": true,
"assets": [
"projects/adm/src/favicon.ico",
"projects/adm/src/assets",
{
"glob": "**",
"input": "dist/ui-kit/assets",
"output": "pacto-ui"
}
],
"styles": [
"node_modules/ng-snotify/styles/material.scss",
"projects/adm/src/styles.scss",
"dist/ui-kit/assets/ui-kit.scss",
"dist/ui-kit/assets/scss/material-theme.scss",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/moment/min/moment.min.js",
"node_modules/apexcharts/dist/apexcharts.min.js"
]
},
"configurations": {
"es": {
"localize": [
"es"
],
"outputPath": "dist/adm"
},
"en": {
"localize": [
"en"
],
"outputPath": "dist/adm"
},
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "12mb",
"maximumError": "15mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "12kb",
"maximumError": "15kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"vendorSourceMap": true,
"browserTarget": "adm:build"
},
"configurations": {
"production": {
"browserTarget": "adm:build:production"
},
"es": {
"browserTarget": "adm:build:es"
},
"en": {
"browserTarget": "adm:build:en"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "adm:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/adm/src/test.ts",
"polyfills": "projects/adm/src/polyfills.ts",
"tsConfig": "projects/adm/tsconfig.spec.json",
"karmaConfig": "projects/adm/karma.conf.js",
"assets": [
"projects/adm/src/favicon.ico",
"projects/adm/src/assets"
],
"styles": [
"projects/adm/src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/adm/tsconfig.app.json",
"projects/adm/tsconfig.spec.json",
"projects/adm/e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "projects/adm/e2e/protractor.conf.js",
"devServerTarget": "adm:serve"
},
"configurations": {
"production": {
"devServerTarget": "adm:serve:production"
}
}
},
"extract-i18n-merge": {
"builder": "ng-extract-i18n-merge:ng-extract-i18n-merge",
"options": {
"format": "xlf",
"outputPath": "projects/adm/i18n",
"targetFiles": [
"messages.es.xlf",
"messages.en.xlf"
]
}
}
}
},
daniel-sc commented
@lsrsilva Only Angular 13+ is supported - see #39 (comment)
lsrsilva commented
oh I see!
thanks for answering. I'm proceed with the updates so.