Skip to content

Control Flow Migration Bug in Nx Workspace #52787

@Coly010

Description

@Coly010

Command

generate

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Control Flow Migration Fails despite a valid path being provided in an Nx Workspace.

It fails with the following error:

SchematicsException [Error]: Could not find any files to migrate under the path /<snip>/ng-control-flow-mig-repro/libs/mylib. Cannot run the control flow migration.

The schematic finds an incorrect tsconfig file for the path provided.

Expected:

  1. Allow a path to a tsconfig to be provided --tsconfigPath
  2. Find the closest tsconfig file to the path

Minimal Reproduction

Clone Repo: https://github.com/Coly010/ng-control-flow-mig-repro

Run nx generate @angular/core:control-flow-migration --path=libs/mylib

Exception or Error

SchematicsException [Error]: Could not find any files to migrate under the path /<snip>/ng-control-flow-mig-repro/libs/mylib. Cannot run the control flow migration.



### Your Environment

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


Angular CLI: 17.0.0
Node: 18.14.0
Package Manager: npm 9.4.2
OS: darwin x64

Angular: 17.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0
@angular-devkit/build-angular   17.0.0
@angular-devkit/core            17.0.0
@angular-devkit/schematics      17.0.0
@angular/cli                    17.0.0
@angular/ssr                    17.0.0
@schematics/angular             17.0.0
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2
 >  NX   Report complete - copy this into the issue template

   Node   : 18.14.0
   OS     : darwin-x64
   npm    : 9.4.2

   nx (global)        : 16.0.0-beta.6
   nx                 : 17.1.1
   @nx/js             : 17.1.1
   @nx/jest           : 17.1.1
   @nx/linter         : 17.1.1
   @nx/eslint         : 17.1.1
   @nx/workspace      : 17.1.1
   @nx/angular        : 17.1.1
   @nx/cypress        : 17.1.1
   @nx/devkit         : 17.1.1
   @nx/eslint-plugin  : 17.1.1
   @nrwl/tao          : 17.1.1
   @nx/web            : 17.1.1
   @nx/webpack        : 17.1.1
   typescript         : 5.2.2


### Anything else relevant?

_No response_

Metadata

Metadata

Assignees

Labels

area: migrationsIssues related to `ng update`/`ng generate` migrations

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions