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.

Breaking changes in `nx print-affected` when moving from 14.1.9 to 14.2.2

See original GitHub issue

Current Behavior

We use nx print-affected and pipe it to a JSON file. We then use that to implement linting around our local package dependencies.

In 14.2.2 a the affected json file might look like:

{
  "tasks": [],
  "projects": [],
  "projectGraph": {
    "nodes": [
      "myApp",
      "myLib",
    ],
    "dependencies": {
      "myApp": [
        {
          "source": "myApp",
          "target": "npm:axios",
          "type": "static"
        },
      ]
   // …
}       

Expected Behavior

{
  "tasks": [],
  "projects": [],
  "projectGraph": {
    "nodes": [
      "myApp",
      "myLib",
    ],
    "dependencies": {
      "myApp": [
        {
          "source": "myApp",
          "target": "myLib", // THIS IS MISSING IN 14.2.2
          "type": "static"
        },
        {
          "source": "myApp",
          "target": "npm:axios",
          "type": "static"
        },
      ]
   // …
}       

Notice the key difference – that a local dependency on myLib is no longer exposed in the print-affected project graph.

Steps to Reproduce

  1. make a project using nx <= 14.1.9
  2. make the project have at least 1 application target that depends on at least 1 local library target
  3. examine the output of nx print-affected
  4. notice that the dependency on the local library targets are documented via a "target" line that does not include npm:
  5. upgrade to nx 14.2.2 & compare the output of nx print-affected
  6. Notice that the local dependencies are no longer described in the projectGraph::dependencies node

Failure Logs

No failure logs present – just undocumented breaking changes

Environment

>  NX   Report complete - copy this into the issue template

   Node : 16.12.0
   OS   : darwin x64
   yarn : 1.22.17
   
   nx : 14.2.2
   @nrwl/angular : Not Found
   @nrwl/cypress : 14.2.2
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.2.2
   @nrwl/eslint-plugin-nx : 14.2.2
   @nrwl/express : 14.2.2
   @nrwl/jest : 14.2.2
   @nrwl/js : 14.2.2
   @nrwl/linter : 14.2.2
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : 14.2.2
   @nrwl/nx-cloud : 14.0.8
   @nrwl/nx-plugin : 14.2.2
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : 14.2.2
   @nrwl/workspace : 14.2.2
   typescript : 4.7.3
   ---------------------------------------
   Community plugins:

✨  Done in 0.72s.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AgentEndercommented, Jun 9, 2022

nx migrate latest --from 14.1.9 would recreate a migrations json with those

0reactions
fbarthocommented, Jun 9, 2022

Thanks for the help @AgentEnder! Closing the ticket.

Idea: documentation on the recommended way to integrate nx migrate with dependabot would have helped us avoid this mistake (unclear how it happened still, if it was a manual error or a bug somewhere).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serena PVCS Version Manager Release Notes - Micro Focus
This file lists the defects fixed, enhancements made, and behaviors changed in each release of Version Manager. For information on installing and using...
Read more >
Debugging with gdb - GCC for Renesas
the gdb commands set environment and unset environment to change parts of the environment that affect your program. See Section 4.4 [Your Program's....
Read more >
APEX Calculus
sensitive to changes in the radius or the height? 14. Projectile Motion: The x-value of an object moving under the principles of projectile....
Read more >
ECMAScript® 2021 Language Specification - TC39
ECMAScript usage has moved beyond simple scripting and it is now used for the full spectrum of programming tasks in many different environments...
Read more >
Objective Grid User's Guide - Documentation
6.1 How Objective Grid Affects the Size of Your Application 155 ... 20.2 Adding Page Break and Scaled Printing Support 428.
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