Skip to content

NG17-RC0: Next8->RC0 changed angular.json #26063

Closed
@spock123

Description

@spock123

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

It looks like going from Next8 -> RC0 broke our development build, as it appears to have modified angular.json, clearing out the serve->configurations values

When starting our application in development mode, we now get the following error:

ng serve --host=0.0.0.0 --port=4000 --configuration=local

Error: Schema validation failed with the following errors:
  Data path "" must have required property 'buildTarget'.
  Data path "" must have required property 'browserTarget'.
  Data path "" must match a schema in anyOf.
/Users/spock/projects/fresto/apps/totti/node_modules/@angular-devkit/architect/node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js:13
            throw err;
            ^

SchemaValidationException [Error]: Schema validation failed with the following errors:
  Data path "" must have required property 'buildTarget'.
  Data path "" must have required property 'browserTarget'.
  Data path "" must match a schema in anyOf.
    at /Users/spock/projects/fresto/apps/totti/node_modules/@angular-devkit/architect/src/architect.js:40:27 {
  errors: [
    {
      instancePath: '',
      schemaPath: '#/anyOf/0/required',
      keyword: 'required',
      params: { missingProperty: 'buildTarget' },
      message: "must have required property 'buildTarget'"
    },
    {
      instancePath: '',
      schemaPath: '#/anyOf/1/required',
      keyword: 'required',
      params: { missingProperty: 'browserTarget' },
      message: "must have required property 'browserTarget'"
    },
    {
      instancePath: '',
      schemaPath: '#/anyOf',
      keyword: 'anyOf',
      params: {},
      message: 'must match a schema in anyOf'
    }
  ]
}

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

It's apparently complaining about a syntax issue in angular.json but this has worked in every 17-next-X version. The error only started occurring after upgrading to RC0.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.0.0-next.9
Node: 18.18.1
Package Manager: npm 9.8.1
OS: darwin arm64

Angular: 17.0.0-rc.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, material, material-date-fns-adapter
... platform-browser, platform-browser-dynamic, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0-next.9
@angular-devkit/build-angular   17.0.0-next.9
@angular-devkit/core            17.0.0-next.9
@angular-devkit/schematics      17.0.0-next.9
@angular/cli                    17.0.0-next.9
@angular/fire                   7.5.0
@angular/ssr                    17.0.0-next.1
@schematics/angular             17.0.0-next.9
rxjs                            7.5.7
typescript                      5.2.2
zone.js                         0.14.0

Anything else?

Angular.json:


{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "cli": {
        "packageManager": "npm",
        "analytics": "ac59db6d-a680-408f-af50-2623fb62aeae"
    },
    "newProjectRoot": "projects",
    "projects": {
        "totti": {
            "projectType": "application",
            "schematics": {
                "@schematics/angular:component": {
                    "style": "scss",
                    "skipTests": true,
                    "standalone": true,
                    "changeDetection": "OnPush"
                },
                "@schematics/angular:class": {
                    "skipTests": true
                },
                "@schematics/angular:directive": {
                    "skipTests": true,
                    "standalone": true
                },
                "@schematics/angular:guard": {
                    "skipTests": true
                },
                "@schematics/angular:interceptor": {
                    "skipTests": true
                },
                "@schematics/angular:pipe": {
                    "skipTests": true,
                    "standalone": true
                },
                "@schematics/angular:resolver": {
                    "skipTests": true
                },
                "@schematics/angular:service": {
                    "skipTests": true
                }
            },
            "root": "",
            "sourceRoot": "src",
            "prefix": "app",
            "i18n": {
                "sourceLocale": "en-US",
                "locales": {
                    "da": {
                        "translation": "src/locale/messages.da.json"
                    },
                    "en": {
                        "translation": "src/locale/messages.en.json"
                    }
                }
            },
            "architect": {
                "build": {
                    "builder": "@angular-devkit/build-angular:browser",
                    "options": {
                        "allowedCommonJsDependencies": [],
                        "outputPath": "dist/totti/",
                        "index": "src/index.html",
                        "main": "src/main.ts",
                        "polyfills": ["zone.js"],
                        "tsConfig": "tsconfig.app.json",
                        "inlineStyleLanguage": "scss",
                        "styles": ["src/styles/index.scss"],
                        "assets": ["src/assets", "src/robots.txt", "src/manifest.json"],
                        "scripts": [],
                        "serviceWorker": true,
                        "ngswConfigPath": "ngsw-config.json",
                        "localize": true,
                        "i18nDuplicateTranslation": "ignore"
                    },
                    "configurations": {
                        "production": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.prod.ts"
                                },
                                {
                                    "replace": "src/app/shared/store/build-specifics/index.ts",
                                    "with": "src/app/shared/store/build-specifics/index.prod.ts"
                                }
                            ],
                            "outputHashing": "all",
                            "vendorChunk": false,
                            "buildOptimizer": true,
                            "serviceWorker": true,
                            "namedChunks": false
                        },
                        "localprod": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.localprod.ts"
                                }
                            ],
                            "outputHashing": "all"
                        },
                        "test": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.test.ts"
                                },
                                {
                                    "replace": "src/app/shared/store/build-specifics/index.ts",
                                    "with": "src/app/shared/store/build-specifics/index.prod.ts"
                                }
                            ],
                            "outputHashing": "all",
                            "vendorChunk": false,
                            "buildOptimizer": true,
                            "serviceWorker": true,
                            "namedChunks": false
                        },
                        "localtest": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.test.ts"
                                }
                            ],
                            "outputHashing": "all"
                        },
                        "development": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.dev.ts"
                                },
                                {
                                    "replace": "src/app/shared/store/build-specifics/index.ts",
                                    "with": "src/app/shared/store/build-specifics/index.prod.ts"
                                }
                            ],
                            "outputHashing": "all",
                            "sourceMap": true,
                            "vendorChunk": false,
                            "buildOptimizer": false,
                            "serviceWorker": true,
                            "namedChunks": false
                        },
                        "local": {
                            "buildOptimizer": false,
                            "optimization": false,
                            "sourceMap": true
                        },
                        "da": {
                            "localize": ["da"]
                        },
                        "en": {
                            "localize": ["en"]
                        }
                    },
                    "defaultConfiguration": "production"
                },
                "serve": {
                    "builder": "@angular-devkit/build-angular:dev-server",
                    "configurations": {
                        "production": {
                        },
                        "localprod": {
                        },
                        "localtest": {
                        },
                        "test": {
                        },
                        "development": {
                        },
                        "local": {
                        },

                        "da": {
                        },
                        "en": {
                        }
                    },
                    "defaultConfiguration": "local"
                },
                "extract-i18n": {
                    "builder": "@angular-devkit/build-angular:extract-i18n",
                    "options": {
                    }
                },
                "test": {
                    "builder": "@angular-devkit/build-angular:karma",
                    "options": {
                        "polyfills": ["zone.js", "zone.js/testing"],
                        "tsConfig": "tsconfig.spec.json",
                        "inlineStyleLanguage": "scss",
                        "assets": ["src/favicon.ico", "src/assets", "src/manifest.json"],
                        "styles": ["src/styles/index.scss"],
                        "scripts": []
                    }
                },
                "deploy": {
                    "builder": "@angular/fire:deploy",
                    "options": {
                        "prerender": false,
                        "ssr": false,
                        "browserTarget": "totti:build:production",
                        "firebaseProject": "fastorder-dev",
                        "firebaseHostingSite": "fresto-totti-dev"
                    }
                }
            }
        }
    }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions