Skip to content

Automated migration use-application-builder can't find Path "src/main.ts" #29661

Closed
@ankurlorecs

Description

@ankurlorecs

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

Command ng update @angular/cli --name use-application-builder fails with error Migration failed: Path "src/main.ts" does not exist even though file exists on this path

Minimal Reproduction

I have upgraded project from Angular 17 to 18.

After that running automatic migration to use-application-builder fails

Here is screenshot including angular.json and folder structure

Image

Exception or Error

Migration failed: Path "src/main.ts" does not exist

Below is error

Image

Below is error log from log file.

[error] Error: Path "src/main.ts" does not exist.
    at HostTree.readText (C:\Users\AT\AppData\Local\Temp\angular-cli-packages-y6v18A\node_modules\@angular-devkit\schematics\src\tree\host-tree.js:220:19)
    at getSourceFile (D:\projects\angular17app\node_modules\@schematics\angular\utility\standalone\util.js:50:26)
    at findBootstrapApplicationCall (D:\projects\angular17app\node_modules\@schematics\angular\utility\standalone\util.js:56:24)
    at isStandaloneApp (D:\projects\angular17app\node_modules\@schematics\angular\utility\ng-ast-utils.js:93:49)
    at D:\projects\angular17app\node_modules\@schematics\angular\ssr\index.js:276:65
    at async callRuleAsync (C:\Users\AT\AppData\Local\Temp\angular-cli-packages-y6v18A\node_modules\@angular-devkit\schematics\src\rules\call.js:77:18)

Your Environment

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


Angular CLI: 18.2.14
Node: 20.18.0
Package Manager: npm 10.8.2
OS: win32 x64

Angular: 18.2.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, 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/cdk                    18.2.14
@angular/cli                    18.2.14
@angular/material               18.2.14
@angular/ssr                    18.2.14
@schematics/angular             18.2.14
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.10

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions