-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
needs: more infoReporter must clarify the issueReporter must clarify the issue
Description
Command
build
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
Can't build the server side with the last @angular/build
package version.
Minimal Reproduction
I have updated my app today to the last version and I have an error when I try to build my server (ssr) side.
Here is my package.json
{
"name": "web-public-static",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"web:start": "ng serve web-public-static --configuration development",
"web:start:prod": "ng serve web-public-static --configuration production",
"web:build:dev": "ng build web-public-static --configuration development",
"web:build:prod": "ng build web-public-static --configuration production",
"dev:ssr": "ng run web-public-static:serve-ssr",
"serve:ssr": "node dist/web-public-static/server/main.js",
"build:ssr": "ng build && ng run web-public-static:server",
"prerender": "ng run web-public-static:prerender",
"web:start:ssr:prod": "npm run build:ssr && npm run serve:ssr"
},
"private": true,
"dependencies": {
"@angular/animations": "20.3.2",
"@angular/cdk": "20.2.5",
"@angular/common": "20.3.2",
"@angular/compiler": "20.3.2",
"@angular/core": "20.3.2",
"@angular/forms": "20.3.2",
"@angular/platform-browser": "20.3.2",
"@angular/platform-browser-dynamic": "20.3.2",
"@angular/platform-server": "20.3.2",
"@angular/router": "20.3.2",
"@angular/ssr": "20.3.3",
"@ng-bootstrap/ng-bootstrap": "19.0.1",
"@popperjs/core": "2.11.8",
"bootstrap": "5.3.8",
"express": "5.1.0",
"flag-icons": "7.5.0",
"primeng": "20.1.2",
"rxjs": "7.8.2",
"tslib": "2.8.1",
"zone.js": "0.15.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "20.3.3",
"@angular/build": "20.3.3",
"@angular/cli": "20.3.3",
"@angular/compiler-cli": "20.3.2",
"@angular/localize": "20.3.2",
"@types/express": "5.0.3",
"@types/jasmine": "5.1.9",
"@types/node": "24.5.2",
"browser-sync": "3.0.4",
"jasmine-core": "5.10.0",
"karma": "6.4.4",
"karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.1",
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
"typescript": "5.8.3"
}
}
And here my angular.json
{
"version" : 1,
"projects" : {
"web-public-static" : {
"projectType" : "application",
"root" : ".",
"sourceRoot" : "src",
"prefix" : "",
"architect" : {
"build" : {
"builder" : "@angular/build:application",
"options" : {
"outputPath" : "dist/web-public-static/browser",
"index" : "src/index.html",
"polyfills" : [
"zone.js"
],
"tsConfig" : "tsconfig.app.json",
"inlineStyleLanguage" : "scss",
"assets" : [
{
"glob" : "**/*",
"input" : "src/assets",
"output" : "assets"
},
{
"glob" : "favicon.ico",
"input" : "src/",
"output" : "/"
},
{
"glob" : "sitemap.xml",
"input" : "src/",
"output" : "/"
}
],
"styles" : [
"src/styles.scss"
],
"scripts" : [
"./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
]
},
"configurations" : {
"production" : {
"budgets" : [
{
"type" : "initial",
"maximumWarning" : "2mb",
"maximumError" : "5mb"
},
{
"type" : "anyComponentStyle",
"maximumWarning" : "12kb",
"maximumError" : "20kb"
}
],
"fileReplacements" : [
{
"replace" : "environments/environment.ts",
"with" : "environments/environment.production.ts"
}
],
"outputHashing" : "all"
},
"development" : {
"optimization" : false,
"extractLicenses" : false,
"sourceMap" : true,
"namedChunks" : true,
"outputHashing" : "media"
}
},
"defaultConfiguration" : "production"
},
"server": {
"builder": "@angular/build:server",
"options": {
"outputPath": "dist/web-public-static/server",
"tsConfig": "tsconfig.server.json",
"main": "server.ts"
},
"configurations": {
"production": {
"optimization": true,
"fileReplacements": [
{
"replace": "environments/environment.ts",
"with": "environments/environment.production.ts"
}
]
},
"development": {
"optimization": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve" : {
"builder" : "@angular/build:dev-server",
"configurations" : {
"production" : {
"buildTarget" : "web-public-static:build:production"
},
"development" : {
"buildTarget" : "web-public-static:build:development"
}
},
"defaultConfiguration" : "development"
},
"serve-ssr" : {
"builder" : "@angular/build:ssr-dev-server",
"configurations" : {
"development" : {
"browserTarget" : "web-public-static:build:development",
"serverTarget" : "web-public-static:server:development"
},
"production" : {
"browserTarget" : "web-public-static:build:production",
"serverTarget" : "web-public-static:server:production"
}
},
"defaultConfiguration" : "development"
},
"prerender" : {
"builder" : "@angular/build:prerender",
"options" : {
"routes" : [
"/"
]
},
"configurations" : {
"production" : {
"browserTarget": "web-public-static:build:production",
"serverTarget": "web-public-static:server:production"
},
"development" : {
"browserTarget": "web-public-static:build:development",
"serverTarget": "web-public-static:server:development"
}
},
"defaultConfiguration" : "production"
}
}
}
},
"cli" : {
"analytics" : false
}
}
When I try to run browser side with
ng serve web-public-static --configuration development
> npm run web:start
(same as scripts show) it works as expected. But when I try to build server side it throws an error
ng build && ng run web-public-static:server
> npm run build:ssr
It finish the build part, but when starts server part, fails.
Exception or Error
Output location: E:\website\dist\web-public-static\browser
An unhandled exception occurred: Cannot find builder "@angular/build:server".
See "C:\Users\xxxxx\AppData\Local\Temp\ng-watc90\angular-errors.log" for further details.
* The terminal process "C:\Program Files\Git\bin\bash.exe '--login', '-i', '-c', 'npm run build:ssr'" terminated with exit code: 127.
* Terminal will be reused by tasks, press any key to close it.
Your Environment
Angular CLI: 20.3.3
Node: 22.14.0
Package Manager: npm 10.8.3
OS: win32 x64
Angular: 20.3.2
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic
... platform-server, router
Package Version
---------------------------------------
@angular-devkit/architect 0.2003.3
@angular-devkit/build-angular 20.3.3
@angular-devkit/core 20.3.3
@angular-devkit/schematics 20.3.3
@angular/build 20.3.3
@angular/cdk 20.2.5
@angular/cli 20.3.3
@angular/ssr 20.3.3
@schematics/angular 20.3.3
rxjs 7.8.2
typescript 5.8.3
zone.js 0.15.1
Anything else relevant?
No response
Metadata
Metadata
Assignees
Labels
needs: more infoReporter must clarify the issueReporter must clarify the issue