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

Unable to execute schematics with object configured via angular.json #19492

Closed
1 of 15 tasks
bgotink opened this issue Nov 27, 2020 · 1 comment · Fixed by #19508
Closed
1 of 15 tasks

Unable to execute schematics with object configured via angular.json #19492

bgotink opened this issue Nov 27, 2020 · 1 comment · Fixed by #19508
Assignees
Labels
area: devkit/core freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Milestone

Comments

@bgotink
Copy link
Contributor

bgotink commented Nov 27, 2020

🐞 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?

Yes, this worked in 11.0.1 / until #18945

Description

It is impossible to start a schematic that has an option of type object where that object comes filled in via the angular.json file.

🔬 Minimal Reproduction

Clone https://github.com/bgotink/angular-cli-repro-19492

Run ng g @repro/schematics:test, get an error.

Comment/delete the default configuration from schematics in angular.json.

Run ng g @repro/schematics:test again, it'll succeed this time.

🔥 Exception or Error

$ ng g @repro/schematics:test
Cannot read property 'constructor' of null

The error is thrown at

const copy = new (Object.getPrototypeOf(valueCasted).constructor)();

🌍 Your Environment



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

Angular CLI: 11.0.2
Node: 12.19.0
OS: darwin x64

Angular: 11.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... 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/core            11.0.2
@angular-devkit/schematics      11.0.2
@schematics/angular             11.0.2
@schematics/update              0.1100.2
rxjs                            6.6.3
typescript                      4.0.5

Anything else relevant?

@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 Dec 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: devkit/core freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants