Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations fail when tsconfig is not in the default location #29754

Closed
1 task
mwaibel-go opened this issue Mar 4, 2025 · 0 comments · Fixed by #29755
Closed
1 task

Migrations fail when tsconfig is not in the default location #29754

mwaibel-go opened this issue Mar 4, 2025 · 0 comments · Fixed by #29755
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix

Comments

@mwaibel-go
Copy link

Command

update

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

When the tsconfig.* files are not in the default location, the migration scripts fail to locate them and abort with an error.

Minimal Reproduction

ng new ang17 # create new project, accept the default options
cd ang17
mv tsconfig* src # move tsconfig to a different location
sed -i 's/tsconfig/src\/tsconfig/g' angular.json # update references to tsconfig
ng update @angular/core@18 @angular/cli@18 # update, enable the use-application-builder migration

# This then outputs Error 1

ng update @angular/core@19 @angular/cli@19 # update, enable the use-application-builder migration

# This outputs Error 2

Exception or Error

# Error 1

The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 18.2.14 to perform the update.
✔ Packages successfully installed.
Using package manager: npm
Collecting installed dependencies...
Found 22 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @angular-devkit/build-angular @ "18.2.14" (was "17.3.12")...
    Updating package.json with dependency @angular/cli @ "18.2.14" (was "17.3.12")...
    Updating package.json with dependency @angular/compiler-cli @ "18.2.13" (was "17.3.12")...
    Updating package.json with dependency @angular/animations @ "18.2.13" (was "17.3.12")...
    Updating package.json with dependency @angular/common @ "18.2.13" (was "17.3.12")...
    Updating package.json with dependency @angular/compiler @ "18.2.13" (was "17.3.12")...
    Updating package.json with dependency @angular/core @ "18.2.13" (was "17.3.12")...
    Updating package.json with dependency @angular/forms @ "18.2.13" (was "17.3.12")...
    Updating package.json with dependency @angular/platform-browser @ "18.2.13" (was "17.3.12")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "18.2.13" (was "17.3.12")...
    Updating package.json with dependency @angular/router @ "18.2.13" (was "17.3.12")...
UPDATE package.json (1047 bytes)
✔ Cleaning node modules directory
✔ Installing packages
** Optional migrations of package '@angular/cli' **

This package has 1 optional migration that can be executed.
Optional migrations may be skipped and executed after the update process, if preferred.

 Select the migrations that you'd like to run [use-application-builder] Migrate application projects to 
the new build system. (https://angular.dev/tools/cli/build-system-migration)

❯ Migrate application projects to the new build system.
  Application projects that are using the '@angular-devkit/build-angular' package's 'browser' and/or 'browser-esbuild' builders will be migrated to use the new 'application' builder.
  You can read more about this, including known issues and limitations, here: https://angular.dev/tools/cli/build-system-migration
✖ Migration failed: Path "tsconfig.json" does not exist.
  See "/tmp/ng-4Cuhlf/angular-errors.log" for further details.

# Error 2

The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 19.2.0 to perform the update.
Using package manager: npm
Collecting installed dependencies...
Found 22 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @angular-devkit/build-angular @ "19.2.0" (was "18.2.14")...
    Updating package.json with dependency @angular/cli @ "19.2.0" (was "18.2.14")...
    Updating package.json with dependency @angular/compiler-cli @ "19.2.0" (was "18.2.13")...
    Updating package.json with dependency typescript @ "5.8.2" (was "5.4.5")...
    Updating package.json with dependency @angular/animations @ "19.2.0" (was "18.2.13")...
    Updating package.json with dependency @angular/common @ "19.2.0" (was "18.2.13")...
    Updating package.json with dependency @angular/compiler @ "19.2.0" (was "18.2.13")...
    Updating package.json with dependency @angular/core @ "19.2.0" (was "18.2.13")...
    Updating package.json with dependency @angular/forms @ "19.2.0" (was "18.2.13")...
    Updating package.json with dependency @angular/platform-browser @ "19.2.0" (was "18.2.13")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "19.2.0" (was "18.2.13")...
    Updating package.json with dependency @angular/router @ "19.2.0" (was "18.2.13")...
    Updating package.json with dependency zone.js @ "0.15.0" (was "0.14.10")...
UPDATE package.json (1036 bytes)
✔ Cleaning node modules directory
✔ Installing packages
** Executing migrations of package '@angular/cli' **

❯ Update '@angular/ssr' import paths to use the new '/node' entry point when 'CommonEngine' is detected.
  Migration completed (No changes made).

❯ Update the workspace configuration by replacing deprecated options in 'angular.json' for compatibility with the latest Angular CLI changes.
  Migration completed (No changes made).

** Optional migrations of package '@angular/cli' **

This package has 1 optional migration that can be executed.
Optional migrations may be skipped and executed after the update process, if preferred.

 Select the migrations that you'd like to run [use-application-builder] Migrate application projects to the new build system. 
(https://angular.dev/tools/cli/build-system-migration)

❯ Migrate application projects to the new build system.
  Application projects that are using the '@angular-devkit/build-angular' package's 'browser' and/or 'browser-esbuild' builders will be migrated to use the new 'application' builder.
  You can read more about this, including known issues and limitations, here: https://angular.dev/tools/cli/build-system-migration
✖ Migration failed: Path "tsconfig.json" does not exist.
  See "/tmp/ng-VNiicY/angular-errors.log" for further details

Your Environment

# Upgrading from 17 to 18
$ ng version

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

Angular CLI: 17.3.10
Node: 18.20.4
Package Manager: npm 10.9.1
OS: linux x64

Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1703.10 (cli-only)
@angular-devkit/core         17.3.10 (cli-only)
@angular-devkit/schematics   17.3.10 (cli-only)
@schematics/angular          17.3.10 (cli-only)

# Upgrading from 18 to 19
$ ng version

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

Angular CLI: 18.2.14
Node: 18.20.4
Package Manager: npm 10.9.1
OS: linux x64

Angular: 18.2.13
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1802.14
@angular-devkit/build-angular   18.2.14
@angular-devkit/core            18.2.14
@angular-devkit/schematics      18.2.14
@angular/cli                    18.2.14
@schematics/angular             18.2.14
rxjs                            7.8.2
typescript                      5.4.5
zone.js                         0.14.10

Anything else relevant?

No response

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Mar 4, 2025
… in application builder migration

If the root tsconfig.json is missing we should not error.

Closes angular#29754
@alan-agius4 alan-agius4 added type: bug/fix area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken labels Mar 4, 2025
alan-agius4 added a commit that referenced this issue Mar 4, 2025
… in application builder migration

If the root tsconfig.json is missing we should not error.

Closes #29754
alan-agius4 added a commit that referenced this issue Mar 4, 2025
… in application builder migration

If the root tsconfig.json is missing we should not error.

Closes #29754

(cherry picked from commit 4f2bcdc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
2 participants