just-jeb / angular-builders

Angular build facade extensions (Jest and custom webpack configuration)
MIT License
1.15k stars 198 forks source link

Schema validation failed with the following errors: Data path "" should NOT have additional properties(customWebpackConfig). #1318

Closed vinitparmar closed 1 year ago

vinitparmar commented 1 year ago

ng serve
Schema validation failed with the following errors: Data path "" should NOT have additional properties(customWebpackConfig).

Details: package.json

{ "name": "csp-ui", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve --proxy-config proxy.conf.json --base-href / --deploy-url /", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^11.2.14", "@angular/cdk": "^11.2.13", "@angular/common": "~11.2.14", "@angular/compiler": "~11.2.14", "@angular/core": "~11.2.14", "@angular/flex-layout": "^9.0.0-beta.31", "@angular/forms": "~11.2.14", "@angular/localize": "^11.2.14", "@angular/material-moment-adapter": "^10.2.5", "@angular/platform-browser": "~11.2.14", "@angular/platform-browser-dynamic": "~11.2.14", "@angular/router": "~11.2.14", "@material/list": "^9.0.0", "@material/tab": "^7.0.0", "@ngtools/webpack": "^11.2.19", "@types/lodash": "^4.14.149", "classlist.js": "^1.1.20150312", "moment": "^2.27.0", "moment-timezone": "^0.5.31", "ngx-dropzone": "^2.2.2", "ngx-dropzone-wrapper": "^9.0.0", "ngx-logger": "^4.1.9", "notosans-fontface": "^1.2.1", "rxjs": "~6.5.4", "tailwindcss": "^2.2.19", "tslib": "^2.0.0", "uuid": "^8.2.0", "web-animations-js": "^2.3.2", "zone.js": "~0.10.3" }, "devDependencies": { "@angular-builders/custom-webpack": "^11.1.0-beta.1", "@angular-devkit/build-angular": "^0.1102.19", "@angular/cli": "^11.2.19", "@angular/compiler-cli": "~11.2.14", "@angular/language-service": "~11.2.14", "@fortawesome/angular-fontawesome": "^0.6.1", "@fortawesome/fontawesome-free": "^5.13.0", "@fortawesome/free-solid-svg-icons": "^5.13.0", "@fullhuman/postcss-purgecss": "^2.2.0", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.12.62", "codelyzer": "^6.0.0", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~6.4.1", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "~7.0.0", "ts-node": "~8.3.0", "tslint": "~6.1.3", "typescript": "~4.1.6" } }

angular.json

{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "cli": { "packageManager": "yarn", "analytics": false }, "newProjectRoot": "projects", "projects": { "csp-ui": { "projectType": "application", "schematics": { "@schematics/angular:component": { "style": "scss" } }, "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "@angular-builders/custom-webpack:browser", "options": { "outputPath": "dist/csp-ui", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", "aot": true, "assets": [ "src/favicon.ico", "src/fauxPage.html", "src/assets" ], "styles": [ "node_modules/@fortawesome/fontawesome-free/css/all.min.css", "src/styles.scss", "src/theme.scss", "src/tailwind.scss" ], "scripts": [], "customWebpackConfig": { "path": "extra-webpack.config.js" } }, "configurations": { "production": { "index": { "input": "src/index.prod.html", "output": "index.html" }, "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": true, "outputHashing": "all", "sourceMap": false, "extractCss": true, "namedChunks": false, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "budgets": [ { "type": "initial", "maximumWarning": "5mb", "maximumError": "10mb" }, { "type": "anyComponentStyle", "maximumWarning": "10kb", "maximumError": "20kb" } ] }, "staging": { "index": { "input": "src/index.staging.html", "output": "index.html" }, "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.staging.ts" } ] }, "test": { "index": { "input": "src/index.test.html", "output": "index.html" }, "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.test.ts" } ] }, "freeze": { "index": { "input": "src/index.freeze.html", "output": "index.html" }, "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.freeze.ts" } ] } } }, "serve": { "builder": "@angular-builders/custom-webpack:dev-server", "options": { "browserTarget": "csp-ui:build", "proxyConfig": "proxy.conf.json", "customWebpackConfig": { "path": "extra-webpack.config.js" } }, "configurations": { "production": { "browserTarget": "csp-ui:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { "browserTarget": "csp-ui: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/fauxPage.html", "src/assets" ], "styles": [ "src/styles.scss", "src/app/file-upload/external/basic.css", "src/app/file-upload/external/cdsDz.css", "src/app/file-upload/external/dropzone.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": "csp-ui:serve" }, "configurations": { "production": { "devServerTarget": "csp-ui:serve:production" } } } } } }, "defaultProject": "csp-ui" }

ng --version

Angular CLI: 11.2.19 Node: 16.15.0 OS: win32 x64

Angular: 11.2.14 ... animations, common, compiler, compiler-cli, core, forms ... language-service, localize, platform-browser ... platform-browser-dynamic, router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.1102.19 @angular-devkit/build-angular 0.1102.19 @angular-devkit/core 11.2.19 @angular-devkit/schematics 11.2.19 @angular/cdk 11.2.13 @angular/cli 11.2.19 @angular/flex-layout 9.0.0-beta.31 @angular/material-moment-adapter 10.2.7 @ngtools/webpack 11.2.19 @schematics/angular 11.2.19 @schematics/update 0.1102.19 rxjs 6.5.5 typescript 4.1.6

Error : ng serve Schema validation failed with the following errors: Data path "" should NOT have additional properties(customWebpackConfig).

arturovt commented 1 year ago

Can you provide a minimal reproducible example?

Note: Our policy is that issues reported without a reproduction will be closed immediately and then reopened once a reproduction has been provided. Please respect the developers of this project by doing this. We give of our personal time to work on this project and would rather be spending our time fixing or enhancing the library than chasing down badly described or unreproducible issues.

arturovt commented 1 year ago

It tells you the error that the serve builder shouldn't contain customWebpackConfig property. Remove the property from the serve target. Closing as not an issue.

vinitparmar commented 1 year ago

Hi Just-Jeb/Angular-Builders

I was trying to build small app as to replicate issue, for that I missed your mail.

I tried removing the property of webpack from angular.json ,it's giving an error as cannot find the css source. Webpack contains the configuration of tailwind.

I have tried various other solution mentioned by the community like updating the angular/webpack version to 11.0.1-beta. still it's giving error

Thanks Vinit parmar

On Wed, 30 Nov, 2022, 8:36 pm Artur Androsovych, @.***> wrote:

It tells you the error that the serve builder shouldn't contain customWebpackConfig property. Remove the property from the serve target. Closing as not an issue.

— Reply to this email directly, view it on GitHub https://github.com/just-jeb/angular-builders/issues/1318#issuecomment-1332310337, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADITCG4NCOGYECGGXXBUVF3WK5UPJANCNFSM6AAAAAASEFC5DA . You are receiving this because you authored the thread.Message ID: @.***>

arturovt commented 1 year ago

I do think there's an issue with your webpack configuration and not with the core builder itself.

vinitparmar commented 1 year ago

Alright, i will give it a try.

Thanks

On Wed, 30 Nov, 2022, 9:01 pm Artur Androsovych, @.***> wrote:

I do think there's an issue with your webpack configuration and not with the core builder itself.

— Reply to this email directly, view it on GitHub https://github.com/just-jeb/angular-builders/issues/1318#issuecomment-1332351526, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADITCGZXZKFN2DQQ6QXMK2LWK5XO5ANCNFSM6AAAAAASEFC5DA . You are receiving this because you authored the thread.Message ID: @.***>