Questions tagged [angular-universal]

Angular Universal is a server-side rendering module for Angular applications.

Better Perceived Performance

First time users of your application will instantly see a server rendered view which greatly improves perceived performance and the overall user experience. According to research at Google, the difference of just 200 milliseconds in page load performance has an impact on user behavior.

Optimized for Search Engines

Although Googlebot crawls and renders most dynamic sites, many search engines expect plain HTML. Server-side pre-rendering is a reliable, flexible and efficient way to ensure that all search engines can access your content.

Site Preview

Ensure that Facebook, Twitter and all other social media apps correctly display a preview image of your app.

Latest Stable Version:

angular 9.x  - (February 6, 2020)

Bits

1755 questions
16
votes
4 answers

(Angular 6) Angular Universal - Not waiting on content API call

Cannot get SSR to work when using Angular Universal with pages that use dynamic content. All other pages work and the dynamic pages return with HTML but do not include the dynamic data. Method Called: ngOnInit() { const div =…
Smokey Dawson
  • 8,827
  • 19
  • 77
  • 152
16
votes
4 answers

Server side rendering using Angular4(Angular Universal)

I am working on an Angular4 webpack project to which I wanted to add AngularUniversal to make server side rendering possible.But most tutorials are using angular cli.I want to integrate Universal with webpack.I tried following this tutorial with no…
RemyaJ
  • 5,358
  • 4
  • 22
  • 41
15
votes
3 answers

npm run build:ssr does not work in angular 8

I use angular 8 and server-side-rendering but i got error when i run npm run build:ssr As you can see, src is repeated twice home/app/front/**src/src**/main.server.ts I tried everything without success. I move main.server.ts and i created a new src…
user9714967
  • 1,534
  • 3
  • 13
  • 21
15
votes
1 answer

Angular (8) Universal with firebase cloud functions - can't match any routes

UPDATE: I created a new project with every angular update there was and now on 8.2.0 it seems to be working. Just follow the instructions below, BUT there's currently a bug within webpack. So, after building "npm run build:ssr" open the server.js in…
15
votes
1 answer

Unable to serve server rendered app due to Firebase's IDBIndex error

My environment Operating System version:Windows 10 Firebase SDK version: 6.0.2 Problem I followed this tutorial for creating server side rendered app. The error occurs when I try to serve the app using npm run serve:ssr. The error I get…
Kartik Watwani
  • 629
  • 8
  • 20
15
votes
3 answers

Angular Universal: navigator is not defined

I followed official angular-cli tutorial to integrate angular-universal to my existing angular-cli app. I am able to do SSR for my angular-cli app. But when I try to integrate ngx-leaflet, I am getting following error: ReferenceError: navigator is…
15
votes
9 answers

Heroku deploy using ts-node

I am trying to deploy a sample of the Angular Universal Starter in Heroku. The task npm start fails because it does not recognize ts-node. Is there a way to make deployment on Heroku work using ts-node?
Joao Garin
  • 573
  • 1
  • 5
  • 16
14
votes
2 answers

Angular Universal "Module file (/src/app/.ts) not found"

I have an app originally developed on Angular 2 that I have slowly migrated over time as new versions of Angular come out using Angular release documentations. Currently the version of the angular in the app is: 7.2.15 I should also add that I have…
Nylon Smile
  • 8,990
  • 1
  • 25
  • 34
14
votes
5 answers

How to get full base URL (including server, port and protocol) in Angular Universal?

I need to get the full base URL (e.g. http://localhost:5000 or https://productionserver.com) of my Angular 2 app so that I can pass it along to a 3rd party service in the context of the app. The app's location varies depending on whether it is…
Andrew Stegmaier
  • 3,429
  • 2
  • 14
  • 26
13
votes
5 answers

ERROR Error: Uncaught (in promise): TypeError: i.BehaviorSubject is not a constructor in Angular 10 SSR

I'm getting this issue after build successfully and run on browser with angular universal Here is my package json : { "name": "ssr", "version": "1.0.0", "private": true, "dependencies": { "@angular/animations": "10.0.5", …
13
votes
2 answers

How to remove Angular Universal on angular project

I enabled angular universal on my project . I would like to remove it completely now. I tried to remove the following files /server.ts /webpack.server.config.js /src/tsconfig.server.json /src/main.server.ts /src/app/app.server.module.ts and remove…
user11912021
13
votes
5 answers

Angular Universal (SSR) Error: Failed to lookup view "index" in views directory

I want to deploy my angular universal app on aws. From my understanding, I can only deploy my app on elastic beanstalk because it needs a web server to run. (It means no S3 deployment). When I deploy my app, I have the following error: Error:…
Johan Rin
  • 1,900
  • 2
  • 20
  • 42
13
votes
3 answers

Angular Universal - Pre-render only for web crawlers?

I am intending to user Angular Universal for server side rendering (SSR) but this should only be done for crawlers and bots from selected search engines. What I want is the following schema: source:…
Stefan Falk
  • 23,898
  • 50
  • 191
  • 378
13
votes
2 answers

Add static pre-rendering to ng add @nguniversal/express-engine

I added server side rendering to my Angular project by following the Angular documentation here. I found out that the commands to run the static pre-rendering npm run build:prerender and npm run serve:prerender were not here after using the CLI…
Johan Rin
  • 1,900
  • 2
  • 20
  • 42
13
votes
2 answers

Angular Universal and external apis

Having searched for angular universal for many days I see there is a lack of information of how actually ServerSideRendering works . Let me guide you through my concerns and help me clarify some blur spots. There are pretty many guides telling you…
Dionisis K
  • 614
  • 5
  • 17