Repository navigation
Closed
Labels
area: @angular-devkit/build-angulardevkit/build-angular:serverfreq1: lowOnly reported by a handful of users who observe it rarelyseverity5: regressiontype: bug/fix
Description
Command
other: ng run angular.io-example:server
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
14.2
Description
If an error occurs when compiling Angular for server-side rendering, the build process exits with error code 1 without printing any diagnostic. This makes it near impossible to figure out issues specific to SSR builds.
Minimal Reproduction
- Clone the Reproduction repository
npm installnpm build
The repro is a stripped down variant of the official universal example. There's a syntax error on line 10 of server.ts. Uncommenting from fixes the build.
Exception or Error
Full output for Angular 15:
$ npm run build
> [email protected] build
> ng run angular.io-example:server
✔ Server application bundle generation complete.
$ echo $?
1
Full output for Angular 14.2:
$ npm run build
> [email protected] build
> ng run angular.io-example:server
✔ Server application bundle generation complete.
Initial Chunk Files | Names | Raw Size
main.js | main | 5.68 MB |
| Initial Total | 5.68 MB
Build at: 2023-01-26T07:36:35.761Z - Hash: 2ce5cd4dbb2aca9e - Time: 6918ms
Error: server.ts:10:39 - error TS1005: 'from' expected.
10 import { AppServerModule } /* from */ './src/main.server';
~~~~~~~~~~~~~~~~~~~
Error: Optimization error [main.js]: SyntaxError: Unexpected token: punc ({)
$ echo $?
1
Your Environment
$ npm run ng version
> [email protected] ng
> ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 15.1.3
Node: 18.13.0
Package Manager: npm 8.19.3
OS: linux x64
Angular: 15.1.2
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1501.3
@angular-devkit/build-angular 15.1.3
@angular-devkit/core 15.1.3
@angular-devkit/schematics 15.1.3
@angular/cli 15.1.3
@nguniversal/builders 15.1.0
@nguniversal/express-engine 15.1.0
@schematics/angular 15.1.3
rxjs 7.8.0
typescript 4.8.4
Anything else relevant?
You have details about my environment above. I feel like I have a regular Linux machine. I'm very surprised however that this error would not have been detected earlier, so maybe something's wrong with my setup. EDIT: Reproduced in CI
Metadata
Metadata
Assignees
Labels
area: @angular-devkit/build-angulardevkit/build-angular:serverfreq1: lowOnly reported by a handful of users who observe it rarelyseverity5: regressiontype: bug/fix
Activity
fix(@angular-devkit/build-angular): printed server builder errors and…
fix(@angular-devkit/build-angular): printed server builder errors and…
fix(@angular-devkit/build-angular): printed server builder errors and…
fix(@angular-devkit/build-angular): printed server builder errors and…
fix(@angular-devkit/build-angular): printed server builder errors and…
fix(@angular-devkit/build-angular): print server builder errors and w…
fix(@angular-devkit/build-angular): print server builder errors and w…
fix(@angular-devkit/build-angular): print server builder errors and w…
angular-automatic-lock-bot commentedon Feb 26, 2023
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.