Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ng update from 11 to 12 must remove skipTests option from @schematics/angular:module in angular.json #20862

Closed
1 of 15 tasks
msieurtoph opened this issue May 20, 2021 · 2 comments

Comments

@msieurtoph
Copy link

msieurtoph commented May 20, 2021

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No. I guess it comes with the 12.x evolutions of the framework.

Description

Running the update from 11 to 12 forgets to remove the following schematics option of the angular.json (if it exists) :
        "@schematics/angular:module": {
          "skipTests": true 
        },

Schematics seemed to have changed about "module" items with the 12.x and running ng generate module after update gives the following error :

$ ng g m dashboards/roadmap --routing=true --route=roadmap --module dashboards -d
Schematic input does not validate against the Schema: {"skipTests":true,"routing":true,"route":"roadmap","project":"frontend","module":"dashboards","name":"dashboards/roadmap"}
Errors:

  Data path "" must NOT have additional properties(skipTests).

🔬 Minimal Reproduction

  1. Having a project created with a cli < 12.0 and with the options --skipTests = true
  2. Running ng update to migrate to 12.x version.
  3. Running ng generate module xxxxx

🔥 Exception or Error



 Schematic input does not validate against the Schema: {"skipTests":true,"routing":true,"route":"roadmap","project":"frontend","module":"dashboards","name":"dashboards/roadmap"}
Errors:

  Data path "" must NOT have additional properties(skipTests).

🌍 Your Environment



$ ng version

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


Angular CLI: 12.0.0
Node: 14.15.1
Package Manager: npm 6.14.8
OS: win32 x64

Angular: 12.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, material-moment-adapter
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1200.0
@angular-devkit/build-angular   12.0.0
@angular-devkit/core            12.0.0
@angular-devkit/schematics      12.0.0
@schematics/angular             12.0.0
rxjs                            7.0.1
typescript                      4.2.4

Anything else relevant?

Comparing with an app generated with the12.x cli (ng new xxxxx --skipTest=true), I could see the block "@schematics/angular:module" is not part of the "schematics" option of the angular anymore.
I tried to remove it from my project's angular.json and the error disappears.
That why I report this issue.

@alan-agius4
Copy link
Collaborator

Duplicate of #20848

@alan-agius4 alan-agius4 marked this as a duplicate of #20848 May 20, 2021
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants