Closed miladfm closed 6 years ago
@miladfm are you sure that your angular.json/ angular-cli.json file contains a valid json? Please share it with me, so i could take a look.
Closing the issue, no activity
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"MyProject": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"stylePreprocessorOptions": {
"includePaths": [
"src/scss"
]
},
"assets": [
"src/assets",
"src/favicon.ico",
"src/manifest.json"
],
"styles": [
"node_modules/videogular2/fonts/videogular.css",
"node_modules/simplebar/dist/simplebar.css",
"node_modules/ngx-toastr/toastr.css",
"src/vendors/bootstrap/bootstrap.css",
"src/vendors/swiper/swiper.css",
"src/vendors/reset.css",
"src/vendors/fontawesome5/web-fonts-with-css/css/fontawesome-all.min.css",
"src/vendors/animate-css/animate.min.css",
"src/vendors/flagIcon/css/flag-icon.css",
"src/vendors/auto-complete/auto-complete.css",
"src/vendors/pretty-checkbox/pretty-checkbox.min.css",
"src/scss/themes/angular-material-custom-theme.scss",
"src/scss/vendors/hover.css/css/hover.css",
"src/scss/global-styles.scss",
"src/tmp-styles.scss"
],
"scripts": [
"src/vendors/swiper/swiper.js",
"src/vendors/greensock/plugins/ThrowPropsPlugin.min.js",
"src/vendors/greensock/plugins/ScrollToPlugin.min.js",
"src/vendors/greensock/plugins/CSSPlugin.min.js",
"src/vendors/greensock/utils/Draggable.min.js",
"src/vendors/greensock/TweenLite.min.js",
"node_modules/hammerjs/hammer.js",
"node_modules/simplebar/dist/simplebar.js",
"src/vendors/auto-complete/auto-complete.js",
"src/vendors/auto-complete/FuzzySearch.js",
"src/vendors/wavesurfer/wavesurfer.min.js"
]
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": false,
"serviceWorker": false,
"ngswConfigPath": "src/ngsw-config.json",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "MyProject:build"
},
"configurations": {
"production": {
"browserTarget": "MyProject:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "MyProject:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [
"src/vendors/swiper/swiper.js",
"src/vendors/greensock/plugins/ThrowPropsPlugin.min.js",
"src/vendors/greensock/plugins/ScrollToPlugin.min.js",
"src/vendors/greensock/plugins/CSSPlugin.min.js",
"src/vendors/greensock/utils/Draggable.min.js",
"src/vendors/greensock/TweenLite.min.js",
"node_modules/hammerjs/hammer.js",
"node_modules/simplebar/dist/simplebar.js",
"src/vendors/auto-complete/auto-complete.js",
"src/vendors/auto-complete/FuzzySearch.js",
"src/vendors/jquery/jquery.min.js",
"src/vendors/caret/jquery.caret.min.js",
"src/vendors/wavesurfer/wavesurfer.min.js"
],
"styles": [
"node_modules/videogular2/fonts/videogular.css",
"node_modules/simplebar/dist/simplebar.css",
"node_modules/ngx-toastr/toastr.css",
"src/vendors/bootstrap/bootstrap.css",
"src/vendors/nouislider/nouislider.css",
"src/vendors/swiper/swiper.css",
"src/vendors/reset.css",
"src/vendors/fontawesome5/web-fonts-with-css/css/fontawesome-all.min.css",
"src/vendors/animate-css/animate.min.css",
"src/vendors/flagIcon/css/flag-icon.css",
"src/vendors/auto-complete/auto-complete.css",
"src/vendors/pretty-checkbox/pretty-checkbox.min.css",
"src/scss/themes/angular-material-custom-theme.scss",
"src/scss/vendors/hover.css/css/hover.css",
"src/scss/global-styles.scss",
"src/tmp-styles.scss"
],
"assets": [
"src/assets/**",
"src/favicon.ico",
"src/manifest.json"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"MyProject-e2e": {
"root": "",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "MyProject:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "MyProject",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
@miladfm i checked your JSON config and i don't see any issue, probably you see this error message when you editing the angular.json file, basically after every change this extension tries to parse the config values from the angular.json file, the error message indicates that it was unable to parse the file do to some issue(like invalid JSON which happens when you type). However based on the code i see that dialog with error message doesn't disappear automatically, which may be it. Can you verify that if you close it manually next time you open/ save the file it doesn't appear again?
Hi I upgrade angular 8 to 10 .But now I have same problem Invalid schema detected in .angular.json, please correct and try again! What is the soltuion? How can I detect problem.
@ivalexa I'm also having this issue in angular 10, the error doesn't give a clue as to the problem. I'm not changing the file, it happens when I open the solution.
Can this error be made more meaningful or removed?
This is still happening.
Invalid schema detected in .angular.json, please correct and try again!
Vscode version 1.64.2 @angular/core version 12.2.15
Having the same issue after adding comments to the angular.json
file.
Comments are allowed inside the angular.json
according to Angular. See https://github.com/angular/angular-cli/pull/9615#issuecomment-378633653 & https://github.com/cyrilletuzi/vscode-angular-schematics/issues/153#issuecomment-633880673
Even tsconfig.json
allows it: https://github.com/microsoft/TypeScript/issues/4987
@ivalexa Any change in getting support for JSONC Angular Config files?
{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "cli": { "analytics": false }, "version": 1, "newProjectRoot": "projects", "projects": { "newCRM": { "projectType": "application", "schematics": { "@schematics/angular:application": { "strict": true } }, "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", "assets": ["src/favicon.ico", "src/assets"], "styles": [ "node_modules/font-awesome/css/font-awesome.css", "node_modules/animate.css/animate.min.css", "node_modules/icheck/skins/square/green.css", "node_modules/footable/css/footable.core.min.css", "node_modules/clockpicker/src/clockpicker.css", "node_modules/dropzone/dist/min/dropzone.min.css", "node_modules/primeng/resources/primeng.min.css", "node_modules/primeicons/primeicons.css", "node_modules/bootstrap/dist/css/bootstrap.min.css", "node_modules/jasny-bootstrap/dist/css/jasny-bootstrap.min.css", "node_modules/@swimlane/ngx-datatable/release/index.css", "node_modules/@swimlane/ngx-datatable/release/assets/icons.css", "node_modules/froala-editor/css/froala_editor.pkgd.min.css", "node_modules/froala-editor/css/froala_style.min.css", "node_modules/select2/dist/css/select2.min.css", "node_modules/primeng/resources/themes/nova/theme.css", "src/assets/styles/dependencies/ngx-datatable/material.css", "src/assets/styles/dependencies/ngx-datatable/bootstrap.scss", "node_modules/quill/dist/quill.core.css", "node_modules/quill/dist/quill.snow.css", "node_modules/primeflex/primeflex.css" ], "scripts": [ "node_modules/jquery/dist/jquery.js", "node_modules/bootstrap/dist/js/bootstrap.min.js", "node_modules/metismenu/dist/metisMenu.js", "node_modules/jquery-slimscroll/jquery.slimscroll.min.js", "src/assets/js/inspinia.js", "node_modules/icheck/icheck.min.js", "node_modules/footable/dist/footable.all.min.js", "node_modules/clockpicker/dist/bootstrap-clockpicker.min.js", "node_modules/clockpicker/src/clockpicker.js", "node_modules/jasny-bootstrap/dist/js/jasny-bootstrap.min.js", "node_modules/froala-editor/js/froala_editor.pkgd.min.js", "node_modules/select2/dist/js/select2.min.js", "node_modules/quill/dist/quill.js" ] }, "configurations": { "production": { "budgets": [ { "type": "initial", "maximumWarning": "2mb", "maximumError": "5mb" } ], "aot": true, "outputHashing": "all", "sourceMap": false, "extractCss": true, "namedChunks": false, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": false, "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ] }, "development": { "buildOptimizer": false, "optimization": false, "vendorChunk": true, "extractLicenses": false, "sourceMap": true, "namedChunks": true } }, "defaultConfiguration": "production" }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "configurations": { "production": { "browserTarget": "newCRM:build:production" }, "development": { "browserTarget": "newCRM:build:development" } }, "defaultConfiguration": "development" }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { "browserTarget": "newCRM:build" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.spec.json", "karmaConfig": "./karma.conf.js", "assets": ["src/favicon.ico", "src/assets"], "scripts": [ "node_modules/jquery/dist/jquery.js", "node_modules/bootstrap/dist/js/bootstrap.min.js", "node_modules/metismenu/dist/metisMenu.js", "node_modules/jquery-slimscroll/jquery.slimscroll.min.js", "src/assets/js/inspinia.js", "node_modules/icheck/icheck.min.js", "node_modules/footable/dist/footable.all.min.js", "node_modules/clockpicker/dist/bootstrap-clockpicker.min.js", "node_modules/clockpicker/src/clockpicker.js", "node_modules/jasny-bootstrap/dist/js/jasny-bootstrap.min.js", "node_modules/froala-editor/js/froala_editor.pkgd.min.js", "node_modules/select2/dist/js/select2.min.js", "node_modules/quill/dist/quill.js" ], "styles": [ "node_modules/bootstrap/dist/css/bootstrap.css", "node_modules/font-awesome/css/font-awesome.css", "node_modules/animate.css/animate.min.css", "node_modules/icheck/skins/square/green.css", "node_modules/footable/css/footable.core.min.css", "node_modules/clockpicker/src/clockpicker.css", "node_modules/dropzone/dist/min/dropzone.min.css", "node_modules/jasny-bootstrap/dist/css/jasny-bootstrap.min.css", "node_modules/@swimlane/ngx-datatable/release/index.css", "src/assets/styles/dependencies/ngx-datatable/material.css", "src/assets/styles/dependencies/ngx-datatable/bootstrap.scss", "node_modules/@swimlane/ngx-datatable/release/assets/icons.css", "node_modules/froala-editor/css/froala_editor.pkgd.min.css", "node_modules/froala-editor/css/froala_style.min.css", "node_modules/select2/dist/css/select2.min.css", "node_modules/quill/dist/quill.core.css", "node_modules/quill/dist/quill.snow.css", "node_modules/primeng/resources/primeng.min.css", "node_modules/primeng/resources/themes/nova/theme.css", "node_modules/primeflex/primeflex.css", "node_modules/primeicons/primeicons.css", "src/assets/styles/style.scss" ] } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"], "exclude": ["/node_modules/"] } } } } }, "defaultProject": "newCRM", "schematics": { "@schematics/angular:class": {}, "@schematics/angular:component": { "inlineStyle": false, "inlineTemplate": false, "prefix": "app", "style": "scss" }, "@schematics/angular:directive": { "prefix": "app" }, "@schematics/angular:module": { "spec": false } } }
help mee .
Invalid schema detected in .angular.json, please correct and try again!
i receive a new Error for a week:
Invalid schema detected in .angular-cli.json, please correct and try again!