Skip to content

Schema validation failed for Lazy CSS extraction in angular.json #19504

@Azbesciak

Description

@Azbesciak

🐞 bug report

Affected Package

core/cli

The issue is caused by package @angular/....

Is this a regression?

I think it is.

Yes, the previous version in which this bug was not present was: ....

Description

Hello,
I just updated from 10 to 11. In my app I changed themes with lazy css replacement, like:

"styles": [
              "apps/.../src/styles.scss",
              {
                "input": "apps/.../src/dark-styles.scss",
                "bundleName": "dark-styles",
                "inject": true,
                "lazy": true
              }
            ],

However, after migration lazy is no longer in the schema. Also, when I remove it themes do not work - ok, it generated dark-styles but with hashing. I've tried to add outputHashing: false to it, but also not present in the schema. What should I do? I cannot find any migration reference in this topic.
Thanks.

🔥 Exception or Error


An unhandled exception occurred: Schema validation failed with the following errors:
  Data path ".styles[4]" should NOT have additional properties(lazy).
  Data path ".styles[4]" should be string.
  Data path ".styles[4]" should match exactly one schema in oneOf.

🌍 Your Environment

Angular Version:



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 11.0.2
Node: 14.15.1
OS: win32 x64

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

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1100.2
@angular-devkit/build-angular      0.1100.2
@angular-devkit/build-ng-packagr   0.1002.0
@angular-devkit/core               8.3.23
@angular-devkit/schematics         8.3.23
@angular/cdk                       11.0.1
@angular/material                  11.0.1
@schematics/angular                8.3.23
@schematics/update                 0.1100.2
ng-packagr                         11.0.3
rxjs                               6.6.3
typescript                         4.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions