question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while generating component after upgrading Angular 13 to 14 with nx migrate

See original GitHub issue

I recently used nx migrate to upgrade my environment. When I tried to create a new component, I get strange schematic errors. However, I could create libraries using the Angular cli.

I have seen another issue that is very similar with my problem. Unfortunately it has no connection. #10676

Current Behavior

When I run the component creation command, I get an error message in the terminal.

Expected Behavior

Generate angular component without errors

Steps to Reproduce

  1. Update enviroment from Angular 13 to Angular 14.
  2. Generate Angular component using ng cli or nx cli. ng g c component-name --project=lib-project-name or nx g c component-name --project=lib-project-name

Failure Logs

>  NX  Generating @nrwl/angular:component

InvalidInputOptions [Error]: Schematic input does not validate against the Schema: {"style":"scss","project":"lib-project-name","export":true,"name":"test","displayBlock":false,"inlineStyle":false,"inlineTemplate":false,"standalone":false,"changeDetection":"Default","skipTests":false,"flat":false,"skipImport":false,"skipSelector":false,"type":"component","path":"lib-project-name/src/lib"}

Errors:

  Data path "" must NOT have additional properties(standalone).
    at MapSubscriber.project (***\node_modules\@angular-devkit\schematics\tools\schema-option-transform.js:30:27)
    at MapSubscriber._next (***\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\map.js:49:35)
    at MapSubscriber.Subscriber.next (***\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Subscriber.js:66:18)
    at SafeSubscriber.__tryOrUnsub (***\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Subscriber.js:205:16)
    at SafeSubscriber.next (***\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Subscriber.js:143:22)
    at Subscriber._next (***\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Subscriber.js:89:26)
    at Subscriber.next (***\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Subscriber.js:66:18)
    at SafeSubscriber.__tryOrUnsub (***\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Subscriber.js:205:16)
    at SafeSubscriber.next (***\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Subscriber.js:143:22)
    at ThrowIfEmptySubscriber._next (***\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\throwIfEmpty.js:44:26) {
  errors: [
    {
      instancePath: '',
      schemaPath: '#/additionalProperties',
      keyword: 'additionalProperties',
      params: [Object],
      message: 'must NOT have additional properties'
    }
  ]
}

 >  NX   Schematic input does not validate against the Schema: {"style":"scss","project":"lib-project-name","export":true,"name":"test","displayBlock":false,"inlineStyle":false,"inlineTemplate":false,"standalone":false,"changeDetection":"Default","skipTests":false,"flat":false,"skipImport":false,"skipSelector":false,"type":"component","path":"lib-project-name/src/lib"}

   Errors:

     Data path "" must NOT have additional properties(standalone).
   Pass --verbose to see the stacktrace.

Environment

Node : 16.13.2                                                                                                                                                                                   
   OS   : win32 x64                                                                                                                                                                                 
   npm  : 8.3.2                                                                                                                                                                                     
                                                                                                                                                                                                    
   nx : 14.4.3                                                                                                                                                                                      
   @nrwl/angular : 14.4.3                                                                                                                                                                           
   @nrwl/cypress : 14.4.3                                                                                                                                                                           
   @nrwl/detox : Not Found                                                                                                                                                                          
   @nrwl/devkit : 14.4.3                                                                                                                                                                            
   @nrwl/eslint-plugin-nx : 14.4.3                                                                                                                                                                  
   @nrwl/express : Not Found                                                                                                                                                                        
   @nrwl/jest : 14.4.3                                                                                                                                                                              
   @nrwl/js : 14.4.3                                                                                                                                                                                
   @nrwl/linter : 14.4.3                                                                                                                                                                            
   @nrwl/nest : Not Found                                                                                                                                                                           
   @nrwl/next : Not Found                                                                                                                                                                           
   @nrwl/node : Not Found                                                                                                                                                                           
   @nrwl/nx-cloud : Not Found                                                                                                                                                                       
   @nrwl/nx-plugin : Not Found                                                                                                                                                                      
   @nrwl/react : Not Found                                                                                                                                                                          
   @nrwl/react-native : Not Found                                                                                                                                                                   
   @nrwl/schematics : Not Found                                                                                                                                                                     
   @nrwl/storybook : 14.4.3                                                                                                                                                                         
   @nrwl/web : 14.4.3                                                                                                                                                                               
   @nrwl/workspace : 14.4.3                                                                                                                                                                         
   typescript : 4.7.4                                                                                                                                                                               
   ---------------------------------------                                                                                                                                                          
   Community plugins:                                                                                                                                                                               
         @ngneat/transloco: 3.1.4                                                                                                                                                                   
         @ngrx/component-store: 14.0.2                                                                                                                                                              
         @ngrx/effects: 14.0.2                                                                                                                                                                      
         @ngrx/entity: 14.0.2                                                                                                                                                                       
         @ngrx/router-store: 14.0.2                                                                                                                                                                 
         @ngrx/store: 14.0.2                                                                                                                                                                        
         @ngrx/schematics: 14.0.2                                                                                                                                                                   
         @ngrx/store-devtools: 14.0.2 

Result of npm ls @schematics/angular

+-- @angular/cli@13.3.9
| `-- @schematics/angular@13.3.9
`-- @nrwl/angular@14.4.3
  `-- @schematics/angular@14.0.7

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AgentEndercommented, Jul 29, 2022

You shouldn’t have @angular/cli installed, it’s not needed

0reactions
AgentEndercommented, Oct 26, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while generating Angular component after upgrading ...
This is so weird, after I upgraded from @angular/fire@7.2.1 to latest (v7.4.1) it seems that I can create components now.
Read more >
Generating code using schematics - Angular
A schematic is a template-based code generator that supports complex logic. It is a set of instructions for transforming a software project by...
Read more >
Nx 14.2 - Angular v14, Storybook update, lightweight Nx and ...
As such, if you upgrade to Nx 14.2 ( npx nx migrate latest ), Nx will make sure to also trigger all the...
Read more >
Angular CLI and Nx — Why?. In this blog post, I'll present a…
Also, features like code generation as well as automated code migrations (ng update) help during the development and the maintenance of the project....
Read more >
Automate Updating Dependencies - Nx
Update to the latest Nx version · The installed dependencies are updated including the package.json (and node_modules ). · The source code in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found