简体   繁体   English

Angular 配置未设置到工作区

[英]Angular configuration not set to the workspace

I am facing an issue with localization.我面临本地化问题。 I created a project with two local language support but when I serve the application on my local server I am getting the following error.我创建了一个具有两种本地语言支持的项目,但是当我在本地服务器上提供应用程序时,出现以下错误。

An unhandled exception occurred: Configuration 'en' is not set in the workspace.
See "C:\Users\AcnTUSR\AppData\Local\Temp\ng-IfhkD8\angular-errors.log" for further details.

My angular.json file looks as follows.我的 angular.json 文件如下所示。

    "build": {

              "configurations": {
                "fr": {
                "aot": true,
                "i18nFile": "src/translate/messages.fr.xlf",      
                "i18nFormat": "xlf",      
                "i18nLocale": "fr",      
                "i18nMissingTranslation": "error"    
                 },
                 "en": {
                "aot": true,
                "i18nFile": "src/translate/messages.en.xlf",      
                "i18nFormat": "xlf",      
                "i18nLocale": "en",      
                "i18nMissingTranslation": "error"    
                 }  
               },
    .....

    "serve": {
               "configurations": {
                "fr": {
                "browserTarget": "qwikCollaborator:build:fr" 
                },
                },
               "configurations": {
                "en": {
                "browserTarget": "qwikCollaborator:build:en" 
                } ,
                },
.....

whenever I am hitting the command每当我按下命令时

ng serve --configuration=en

I am getting the following error.我收到以下错误。

An unhandled exception occurred: Configuration 'en' is not set in the workspace.
See "C:\Users\AcnTUSR\AppData\Local\Temp\ng-IfhkD8\angular-errors.log" for further details.

can anyone help me with this?谁能帮我这个? I have both translations files one for english=en language and french=fr language.我有两个翻译文件,一个用于英语=en 语言和 french=fr 语言。

Thanks in Advance!提前致谢!

You have 2 configurations nodes for your serve target, you should only have one您的serve目标有 2 个configurations节点,您应该只有一个

  "serve": {
    "configurations": {
      "fr": { "browserTarget": "qwikCollaborator:build:fr" },
      "en": {"browserTarget": "qwikCollaborator:build:en" } 
      }, 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular - 工作区中未设置配置 - Angular - Configuration is not set in the workspace 配置“开发”未在工作区中设置 Angular - Configuration 'development' is not set in the workspace Angular 工作区中未设置配置“生产” - Angular - Configuration 'production' is not set in the workspace - Angular Angular 12 通用配置“开发”未在工作区中设置 - Angular 12 Universal Configuration 'development' is not set in the workspace Angular ng 服务导致:发生未处理的异常:未在工作区中设置配置“生产” - Angular ng serve leads to: An unhandled exception occurred: Configuration 'production' is not set in the workspace 发生未处理的异常:在工作空间中未设置配置'es5'。 ng在角度8中投放es5 - An unhandled exception occurred: Configuration 'es5' is not set in the workspace. ng serve in angular 8 for es5 发生未处理的异常:工作区中未设置配置“dev” - An unhandled exception occurred: Configuration 'dev' is not set in the workspace 发生未处理的异常:工作区中未设置配置“es” - An unhandled exception occurred: Configuration 'es' is not set in the workspace 发生未处理的异常:工作区中未设置配置“生产” - An unhandled exception occurred: Configuration 'production' is not set in the workspace 如何在 Angular 工作区配置上用属性 fileReplacements 替换文件? - How can I replace file with property fileReplacements on Angular workspace configuration?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM