nx: Building Angular application produces many warning "Project extension with invalid name found"

Current Behavior

Building Angular application produces many warning:

Project extension with invalid name found.

The warning is thrown from: https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/core/src/workspace/json/reader.ts#L205

name is not logged when running Angular builder from nx cli. However, when debugging names that produce warnings are $schema, configFilePath, tags.

image image

Expected Behavior

There should be no such warnings.

Steps to Reproduce

Build Angular application with latest version on nrwl/nx and Angular (v14.0.6).

Environment

 >  NX   Report complete - copy this into the issue template

   Node : 16.16.0
   OS   : darwin x64
   npm  : 8.14.0
   
   nx : 14.4.2
   @nrwl/angular : 14.4.2
   @nrwl/cypress : 14.4.2
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.4.2
   @nrwl/eslint-plugin-nx : 14.4.2
   @nrwl/express : Not Found
   @nrwl/jest : 14.4.2
   @nrwl/js : 14.4.2
   @nrwl/linter : 14.4.2
   @nrwl/nest : 14.4.2
   @nrwl/next : Not Found
   @nrwl/node : 14.4.2
   @nrwl/nx-cloud : 14.2.0
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.4.2
   @nrwl/web : 14.4.2
   @nrwl/workspace : 14.4.2
   typescript : 4.7.4
   ---------------------------------------
   Community plugins:
         @ngrx/effects: 14.0.2
         @ngrx/entity: 14.0.2
         @ngrx/router-store: 14.0.2
         @ngrx/schematics: 14.0.2
         @ngrx/store: 14.0.2
         @ngrx/store-devtools: 14.0.2

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 52
  • Comments: 63 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Thank for reporting this!

We are aware of this issue, and we’re looking into it. It’s something that started to appear in Angular CLI v14.0.6, which was released yesterday. Please note that it doesn’t really cause any issues apart from the noisy logs.

This will be included in the next patch release, keep an eye out for it and migrate after its been released.

The warnings can be ignored, I’m working on a PR to hide them now. Angular Devkit has surfaced a warning whenever workspace configuration contains fields it doesn’t know about, in Nx workspaces this is things like tags, implicitDependencies etc

I believe that @AgentEnder is working on a fix. Maybe we should just wait for that and not post over and over again that ‘it is broken’. Yes this message will occur as long as this issue has not been closed. Let’s just chill and wait for AgentEnder 😎

You could put a hack fix into the node_modules/@angular-devkit/core/src/workspace/json/reader.js file. Where you see lines 52 and 53 replace with:

const specialWorkspaceExtensions = ['cli', 'defaultProject', 'newProjectRoot', 'schematics', '$schema', 'implicitDependencies', 'configFilePath', 'tags'];
const specialProjectExtensions = ['cli', 'schematics', 'projectType', '$schema', 'implicitDependencies', 'configFilePath', 'tags'];

Only if it bothers you a ton… My OCD doesn’t allow for things like this sometimes 😃 I’ve even written scripts to update files like this after npm install so that I don’t have to see the warnings…

I got the below warning; it’s brand new project I created:

Project extension with invalid name (tags) found. Project extension with invalid name (configFilePath) found. Project extension with invalid name ($schema) found. Project extension with invalid name (tags) found. Project extension with invalid name (implicitDependencies) found. Project extension with invalid name (configFilePath) found.

Not sure if that’s related but as I’m trying to upgrade my project to the recently released v14.5.1, I’m also getting a ton of these

Project extension with invalid name (tags) found.
Project extension with invalid name (configFilePath) found.

plus it fails

 ERROR  Failed to run update-tsconfig-target from @angular/cli. This workspace is NOT up to date!

 >  NX   Path "/tsconfig.json" does not exist.

+1 for me when running migration from 13.x -> 14.x

I’ve updated one of my projects to 14.5.1, everything went smoothly. Yes, there are warnings, but 1) I don’t think the Nx team can do anything about it except intercept the output and remove these warnings, but it’s a very hacky and unreliable way - I don’t think their coding standards will allow this level of hackiness; 2) I’m pretty sure developers are aware of the issue and there is no need to “bump” this thread - it’s not cool to hurry up them from our side.

partially solved removing “$schema” and “tags” from any single project.json.

i still have “implicitDependencies” and “configFilePath” as invalid name.

@maphe @bjornharvold I also had the issue with “Path “/tsconfig.json” does not exist.”. The cause was that my tsconfig in root dir had custom name tsconfig.base.json. Workaround is to temporary rename this file to tsconfig.json, run that single migration (by manual modifying migrations.json to contain only that single migration) and changing name back to original.

Apart of that I also report multiple warnings “Project extension with invalid name XXXXX found.”

Hello there, still have image

with nx 14.5.10

probably an issue with schema in angular.json ? seems like it’s saying that’s my schema / tags and prefix for my angular libs are not well recognized.

It seems I might have missed a few fields. I’ll get a PR put up that adds them.

It worked now smoothly, Thanks @AgentEnder I got this fix in 4.5.4

You mean 14.5.4? I have not noticed an improvement on version 14.5.4, I am waiting for the next release.

There’s not one needed, it’s a warning you can ignore

Via migrate

@qortex that would be a valid warning, you must have a property called configurations in some project configuration somewhere or as a root property in workspace json or nx.json… It may be a bit hard to locate the property if you have several projects, but it is a misconfiguration since that doesn’t do anything and you’d probably expect it to.

@muhammadawaisshaikh I’ll check it out, but I think on 14.5.4 it was still there for me.

After removing the $schema still getting those warnings 😞

Ahh, I bet it’s the --project web … thanks! But I wish I’d seen that before I slogged through manually adding angular material 😉