angular-cli
angular-cli copied to clipboard
ng add ssr is not working with @angular/build
Command
add
Is this a regression?
- [X] Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
17
Description
after updating to the new angular/build, ng add @angular/ssr stops working
Minimal Reproduction
- create new Angular 18 project
- replace
@angular-devkit/build-angularwith@angular/buildinangular.json - run
npm i -D@angular/build` - run
npm un @angular-devkit/build-angular - run
npx ng add @angular/ssr
Exception or Error
ng add @angular/ssr
i Using package manager: npm
√ Found compatible package version: @angular/[email protected].
√ Package information loaded.
The package @angular/[email protected] will be installed and executed.
Would you like to proceed? Yes
√ Packages successfully installed.
Path "undefined" does not exist.
Your Environment
Angular CLI: 18.0.1
Node: 20.12.2
Package Manager: npm 10.5.0
OS: win32 x64
Angular: 18.0.0
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1800.1
@angular-devkit/core 18.0.1
@angular-devkit/schematics 18.0.1
@angular/build 18.0.1
@angular/cli 18.0.1
@angular/ssr 18.0.1
@schematics/angular 18.0.1
rxjs 7.8.1
typescript 5.4.5
zone.js 0.14.6
Anything else relevant?
when upgrading from angular 17 to 18 there is optional migration if you selected it it makes angular.json file uses @angular/build:application (not sure why on one project it did, in another project it didn't)
this is the commit details
@angular/cli migration - use-application-builder
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
this makes the concurrency of this issue high