Skip to content

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

Closed

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"
                    }
                }
            }
        }
    }
}

Activity

  1. spock123 commented on Oct 19, 2023

    @spock123
    Author

    Angular.json before installing RC0 (I was using 17-next8)

    
    {
        "$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": {
                                "buildTarget": "totti:build:production"
                            },
                            "localprod": {
                                "buildTarget": "totti:build:localprod"
                            },
                            "localtest": {
                                "buildTarget": "totti:build:localtest"
                            },
                            "test": {
                                "buildTarget": "totti:build:test"
                            },
                            "development": {
                                "buildTarget": "totti:build:development"
                            },
                            "local": {
                                "buildTarget": "totti:build:local,en"
                            },
    
                            "da": {
                                "buildTarget": "totti:build:local,da"
                            },
                            "en": {
                                "buildTarget": "totti:build:local,en"
                            }
                        },
                        "defaultConfiguration": "local"
                    },
                    "extract-i18n": {
                        "builder": "@angular-devkit/build-angular:extract-i18n",
                        "options": {
                            "buildTarget": "totti:build"
                        }
                    },
                    "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"
                        }
                    }
                }
            }
        }
    }
    
    
    
    
    
  2. changed the title [-]NG17-RC0: Error: Schema validation failed[/-] [+]NG17-RC0: Next8->RC0 changed angular.json[/+] on Oct 19, 2023
  3. transferred this issue fromangular/angularon Oct 19, 2023
  4. self-assigned this
    on Oct 19, 2023
  5. added a commit that references this issue on Oct 19, 2023
    8d253d3
  6. alan-agius4 commented on Oct 19, 2023

    @alan-agius4
    Collaborator

    Thanks for reporting the issue. I have a opened a PR to address this.

  7. added a commit that references this issue on Oct 19, 2023
    966b4ff
  8. added 2 commits that reference this issue on Oct 19, 2023
    53f93b9
    d60a6e8
  9. angular-automatic-lock-bot commented on Nov 19, 2023

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  10. locked and limited conversation to collaborators on Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions