You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
It was working with Angular Universal
Description
You’ve encountered an issue where Angular SSR (Server-Side Rendering) isn’t executing your Express code when you run npm run start, but it works as expected when you run npm run build && npm run serve:ssr:<projectname>
Create a new Angular project with SSR support using the following command
ng new --ssr testangularssr1
cd testangularssr1
Choose Sass (SCSS) as your style format.
Add code:
To manage Express and its functionalities, we’ll start by adding a simple route and a console.log.
Open the server.ts file and add the following code snippet below the line server.set('views', browserDistFolder);
console.log(' == Express Works Well == ');
server.get('/required-page', (req, res) => {
res.send('Successful!!');
});
Run serve:
When you run npm run start, I didn’t see the ’ == Express Works Well == ’ message. This suggests that Express might not be running. Additionally, attempting to access the route http://localhost:4200/required-page results in an error.
Exception or Error
ERROR RuntimeError: NG04002: Cannot match any routes. URL Segment: 'required-page'
at Recognizer.noMatchError (/testangularssr1/node_modules/@angular/router/fesm2022/router.mjs:3694:12)
at eval (/testangularssr1/node_modules/@angular/router/fesm2022/router.mjs:3727:20)
at eval (/testangularssr1/node_modules/rxjs/dist/esm/internal/operators/catchError.js:10:39)
at OperatorSubscriber.OperatorSubscriber._error (/testangularssr1/node_modules/rxjs/dist/esm/internal/operators/OperatorSubscriber.js:23:21)
at OperatorSubscriber.error (/testangularssr1/node_modules/rxjs/dist/esm/internal/Subscriber.js:40:18)
at OperatorSubscriber._error (/testangularssr1/node_modules/rxjs/dist/esm/internal/Subscriber.js:64:30)
at OperatorSubscriber.error (/testangularssr1/node_modules/rxjs/dist/esm/internal/Subscriber.js:40:18)
at OperatorSubscriber._error (/testangularssr1/node_modules/rxjs/dist/esm/internal/Subscriber.js:64:30)
at OperatorSubscriber.error (/testangularssr1/node_modules/rxjs/dist/esm/internal/Subscriber.js:40:18)
at OperatorSubscriber._error (/testangularssr1/node_modules/rxjs/dist/esm/internal/Subscriber.js:64:30) {
code: 4002
}
Command
serve
Is this a regression?
The previous version in which this bug was not present was
It was working with Angular Universal
Description
You’ve encountered an issue where Angular SSR (Server-Side Rendering) isn’t executing your Express code when you run
npm run start
, but it works as expected when you runnpm run build && npm run serve:ssr:<projectname>
Minimal Reproduction
First option:
The project is in this url: https://github.com/julianguerrerop202/testangularssr1
Or you could:
Create a project:
Create a new Angular project with SSR support using the following command
ng new --ssr testangularssr1
cd testangularssr1
Add code:
To manage Express and its functionalities, we’ll start by adding a simple route and a console.log.
Open the
server.ts
file and add the following code snippet below the lineserver.set('views', browserDistFolder);
Run serve:
When you run
npm run start
, I didn’t see the ’ == Express Works Well == ’ message. This suggests that Express might not be running. Additionally, attempting to access the route http://localhost:4200/required-page results in an error.Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: