From c676edfaab8227c3f31d7bb5e9fabb5d3c3428c7 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Mon, 29 Sep 2025 15:52:24 +0000 Subject: [PATCH] fix(@schematics/angular): use bracket notation for `process.env['pm_id']` The property `pm_id` on `process.env` comes from an index signature, so it must be accessed with bracket notation (`['pm_id']`) to avoid TypeScript errors. This change corrects the access to `process.env['pm_id']` in the SSR server template. --- .../angular/ssr/files/application-builder/server.ts.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/schematics/angular/ssr/files/application-builder/server.ts.template b/packages/schematics/angular/ssr/files/application-builder/server.ts.template index e7be03e005d9..556d7fbd224d 100644 --- a/packages/schematics/angular/ssr/files/application-builder/server.ts.template +++ b/packages/schematics/angular/ssr/files/application-builder/server.ts.template @@ -51,7 +51,7 @@ app.use((req, res, next) => { * Start the server if this module is the main entry point, or it is ran via PM2. * The server listens on the port defined by the `PORT` environment variable, or defaults to 4000. */ -if (isMainModule(import.meta.url) || process.env.pm_id) { +if (isMainModule(import.meta.url) || process.env['pm_id']) { const port = process.env['PORT'] || 4000; app.listen(port, (error) => { if (error) {