[英]Schematic failures on ng serve
最近,我開始在項目中再次運行ng serve,突然間我收到了原理圖錯誤。 它構建良好。
這是我的應用程序的服務目標:
"serve": {
"builder": "@angular-builders/custom-webpack:server",
"options": {
"customWebpackConfig": {
"path": "./extra-webpack.config.js",
"mergeStrategies": { "module.rules": "prepend" },
"replaceDuplicatePlugins": true
},
"browserTarget": "evidentia4:build"
},
"configurations": {
"production": {
"browserTarget": "evidentia4:build:production"
}
}
}
一年多來沒有變化。 但是現在我得到:
Data path "" should NOT have additional properties(browserTarget).
我將browserTarget移到了customWebpackConfig塊中,現在我得到了
Data path "" should have required property 'main'.
顯然情況已經改變,但是我不知道發生了什么。 我一直在更新角度,現在使用的是版本:
Angular CLI: 8.3.0
Node: 12.7.0
OS: darwin x64
Angular: 8.2.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.801.3
@angular-devkit/build-angular 0.801.3
@angular-devkit/build-optimizer 0.801.3
@angular-devkit/build-webpack 0.801.3
@angular-devkit/core 8.1.3
@angular-devkit/schematics 8.3.0
@angular/cdk 8.1.3
@angular/cli 8.3.0
@angular/flex-layout 8.0.0-beta.26
@angular/material 8.1.3
@ngtools/webpack 8.1.3
@schematics/angular 8.3.0
@schematics/update 0.803.0
rxjs 6.5.2
typescript 3.4.5
webpack 4.39.2
自從angular.json生成以來,我就瞎了。
知道在哪里看嗎?
該angular.json
正在驗證對@angular\\cli\\lib\\config\\schema.json
文件,你必須與此相關的驗證錯誤。 我建議您檢查一下angular.json
是否符合架構。 另外, ng update
命令有助於自動遷移代碼(包括angular.json
),因此您可以嘗試一下。
找到了!
"builder": "@angular-builders/custom-webpack:server"
本來應該
"builder": "@angular-builders/custom-webpack:dev-server"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.