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.

NX The angular.json file is out of sync

See original GitHub issue

Current Behavior

After updating to latest nx Running nx workspace-lint throws error

NX The angular.json file is out of sync and after adding the projects in nx.json

Error-

NX As of Nx 13, project configuration should be moved from nx.json to workspace.json/project.json. Please run "nx format" to fix this.

 >  NX   Cannot read properties of undefined (reading 'endsWith')

Environment

   Node : 16.13.1
   OS   : win32 x64
   yarn : 1.22.17

   nx : 13.9.3
   @nrwl/angular : 13.9.3
   @nrwl/cypress : 13.9.3
   @nrwl/detox : undefined
   @nrwl/devkit : 13.9.3
   @nrwl/eslint-plugin-nx : 13.9.3
   @nrwl/express : undefined
   @nrwl/jest : 13.9.3
   @nrwl/js : undefined
   @nrwl/linter : 13.9.3
   @nrwl/nest : undefined
   @nrwl/next : undefined
   @nrwl/node : undefined
   @nrwl/nx-cloud : undefined
   @nrwl/nx-plugin : undefined
   @nrwl/react : undefined
   @nrwl/react-native : undefined
   @nrwl/schematics : undefined
   @nrwl/storybook : 13.9.3
   @nrwl/web : undefined
   @nrwl/workspace : 13.9.3
   typescript : 4.4.4
   rxjs : 6.6.7
   ---------------------------------------
   Community plugins:
         @ngneat/transloco: 2.23.3

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AgentEndercommented, Apr 6, 2022

Can you try adding this to nx.json?

"workspaceLayout": {
  "appsDir": "apps",
  "libsDir": "libs"
}
0reactions
arshinforcommented, Apr 11, 2022

@AgentEnder I did a fresh start -> migrated to latest nx-13.10.0(followed this issue to resolve migration related problem https://github.com/nrwl/nx/issues/7807 ) and I didn’t got [NX The angular.json file is out of sync] error. I am really unsure from where it came previously, my nx.json looks like this

{
  "npmScope": "desk-ng",
  "affected": {
    "defaultBase": "master"
  },
  "implicitDependencies": {
    "angular.json": "*",
    "package.json": {
      "dependencies": "*",
      "devDependencies": "*"
    },
    "tsconfig.base.json": "*",
    "tslint.json": "*",
    ".eslintrc.json": "*",
    "nx.json": "*"
  },
  "tasksRunnerOptions": {
    "default": {
      "runner": "@nrwl/workspace/tasks-runners/default",
      "options": {
        "cacheableOperations": ["build", "lint", "test", "e2e"],
        "parallel": 3
      }
    }
  },
  "targetDependencies": {
    "build": [
      {
        "target": "build",
        "projects": "dependencies"
      }
    ]
  },
  "cli": {
    "defaultCollection": "@nrwl/angular"
  },
  "defaultProject": "desk-ng",
  "generators": {
    "@nrwl/angular": {
      "application": {
        "linter": "eslint"
      },
      "library": {
        "linter": "eslint"
      },
      "storybook-configuration": {
        "linter": "eslint"
      }
    },
    "@nrwl/angular:application": {
      "style": "scss",
      "linter": "eslint",
      "unitTestRunner": "jest",
      "e2eTestRunner": "cypress"
    },
    "@nrwl/angular:library": {
      "linter": "eslint",
      "unitTestRunner": "jest"
    },
    "@nrwl/angular:component": {
      "style": "scss"
    }
  }
}

and nx report

Node : 16.13.1
   OS   : win32 x64
   yarn : 1.22.17

   nx : 13.10.0
   @nrwl/angular : 13.10.0
   @nrwl/cypress : 13.10.0
   @nrwl/detox : Not Found
   @nrwl/devkit : 13.10.0
   @nrwl/eslint-plugin-nx : 13.10.0
   @nrwl/express : Not Found
   @nrwl/jest : 13.10.0
   @nrwl/js : Not Found
   @nrwl/linter : 13.10.0
   @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 : 13.10.0
   @nrwl/web : Not Found
   @nrwl/workspace : 13.10.0
   typescript : 4.6.3
   rxjs : 6.6.7
   ---------------------------------------

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular.json Invalid in Nx Workspace - Stack Overflow
I recently migrated a usual Angular Application into an Nx Workspace. Badly, I always get an error when trying to run any command...
Read more >
Project Configuration - Nx
json files are located in each project's folder. Nx merges the two files to get each project's configuration. The following configuration creates build...
Read more >
A brand new website interface for an even better experience!
angular.json and nx.json are out of sync.
Read more >
nrwl-nx/community - Gitter
well found the issue, had to do with windows and line endings on the angular.json file. If anyone encounters this issue make sure...
Read more >
What's new in Nx 15?. Nx v15 is finally here! Let's go… - Nx Blog
As a result, this would also not mess with any “watch” process on your dist folder, which you might use. And obviously, we...
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