Questions tagged [angular-ssr]
45 questions
2
votes
1 answer
How to detect an Angular Universal prerender build?
I have an Angular 16 app that will select a random background image once when the app starts up, it works like this:
export class AppComponent implements OnInit {
private readonly backgroundImagesCount = 8;
constructor(@Inject(DOCUMENT) private…

Chris Barr
- 29,851
- 23
- 95
- 135
2
votes
1 answer
Angular Universal application throwing "javascript heap out of memory" error in Docker container after running for a few days
I have an Angular application that has recently been converted to Angular Universal. The application is based on Angular 15 and is running inside a Docker container. The command used to initiate the server is "npm serve:ssr". The application runs…

Pawanpreet Singh
- 229
- 5
- 12
2
votes
2 answers
Angular Universal SSR API Calling two time one from Frontend and Second fro backend
I am trying to achieve SSR using Angular Universal, but facing two problem
I getting two hit on my server as i can see in server logs, one from frontend and second from backend.
when universal sever is calling the api, not injecting data to…

Ashish Srivastava
- 21
- 1
2
votes
1 answer
Preload css in angular 15
I'm crating application in angular with SSR
How do I apply to head section or Link header in order to preload/prefetch whole styles.css file?
Using plain styles.css is not enoug as production…

ciekals11
- 2,032
- 1
- 10
- 24
1
vote
1 answer
Angular SSR build error: got document is not defined error when try to run SSR build
ReferenceError: document is not defined
.../dist/app/server/vendor.js:319308:13
at Module.56601 (.../dist/app/server/vendor.js:319317
dose any one have solution for this error. This error appear when i do SSR build and try to run it.
This…

abhay jani
- 153
- 6
1
vote
0 answers
Angular universal SSR - nginx production deployment issue
I am working on angular application and I have enabled angular universal into it.
On local it is working perfectly. I am able to see all parent and child components getting rendered properly. and Meta tags and Title is also updating in Page source…

PRATHMESH CHOPADE
- 13
- 5
1
vote
0 answers
Deploying an Angular Universal app: Do I need the `server` directory?
I have an Angular 16 app that I built using Angular Universal to pre-render the pages for SEO purposes.
I run ng run project-name:prerender and it generates the following structure
├─ dist
│ ├─ project-name
│ │ ├─ browser
│ │ ├─ server
I can…

Chris Barr
- 29,851
- 23
- 95
- 135
1
vote
0 answers
Typeerror: cannot read properties of undefined (reading 'cssRules') Angular SSR
After angular upgrade from 11 to 15 started getting this error. I am using nodejs version 16.15.1
TypeError: Cannot read properties of undefined (reading 'cssRules')
at appendStylesTo…

Mohsin
- 11
- 3
1
vote
1 answer
What is causing the 502 errors from Nginx after upgrading Angular version with SSR enabled?
I recently updgraded my project from Angular 14 to 15 and started receive 502 errors.
Project works with SSR and Nginx
So, I locally run
npm run build:ssr
receive server and browser dirs, move them on server and on server run nginx in docker with…

Vitaly
- 21
- 3
1
vote
1 answer
Angular SSR: Get Request instance (for grabbing headers) inside a route resolver
I'm working on an SSR project and trying to get the users request headers sent to the node server to parse the accepted language header param inside an angular resolver.
What Im trying to do is redirect the users root route to a preferred language…

Don
- 366
- 1
- 10
0
votes
0 answers
How can I use only one node server for Angular SSR in NX Angular
I have an NX Angular monorepo with almost 40 applications. I want to use Angular SSR for the apps, but based on the standard implementation, this means I would have to run and maintain 40 node servers on the server - one for each app.
Is it good…

shuffler
- 66
- 5
0
votes
1 answer
AdSense causing my Angular 16 site to freeze
I have had Google AdSense for quite a while now and everyting has been working fine in my Angular app. That however has changed in the past few days where I have noticed on mobile devices the site was freezing when I had AdSense running. I could…

Carlos Torrecillas
- 4,965
- 7
- 38
- 69
0
votes
0 answers
Reduce main.js file in Angular
I have an Angular 16 application which has recently been migrated to standalone components and I was able to remove all modules from the entire codebase. That application has SSR set up for SEO purposes and I normally get a warning from the…

Carlos Torrecillas
- 4,965
- 7
- 38
- 69
0
votes
0 answers
Asynchrone API Response not server rendered with Angular SSR
I have an Angular SSR website, which works fine and fast. In the source code I can see everhyting is working as a expexted. However, there is one thing I break my head over all day long.
I have some API calls which would set the meta data in the…

Mattie
- 1
- 1
0
votes
0 answers
NGRX Application to SSR using NG Universal
Application not loading any UI and get this in terminal
HttpErrorResponse {
headers: HttpHeaders {
normalizedNames: Map(0) {},
lazyUpdate: null,
headers: Map(0) {}
},
status: 0,
statusText: 'Unknown Error',
url:…

Samarth
- 1
- 1