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
12
votes
4 answers

"ReferenceError: WebSocket is not defined" when using RxJs WebSocketSubject and Angular Universal

I'm setting up an angular 6.x univeral project in order to leverage its SSR (Server-Side Rendering) capabilities. In my app, I'm using websocket communication using RxJs. More specifically, I'm, using WebSocketSubject and webSocket in my angular…
Ronin
  • 7,322
  • 6
  • 36
  • 54
12
votes
3 answers

Function calls are not supported in decorators while ng build --prod (AOT)

Type of Issue: Bug / Question Description I'm using ng-packagr lib to compile my library to js. I've compiled everything without any problems, but when I'll want to consume my library with ng build --prod (AOT enabled), I'm getting error: ERROR in…
12
votes
1 answer

Server side rendering doesn't wait for API calls to finish

Hi I am using Angular version 4.3 and I have implemented server side rendering as mentioned in this article. https://medium.com/@cyrilletuzi/angular-server-side-rendering-in-node-with-express-universal-engine-dce21933ddce When I hit the server url…
Aniket
  • 4,926
  • 12
  • 41
  • 54
12
votes
1 answer

Angular universal rendering for some routes only

I was playing with angular universal a bit but cant find option to use server side rendering only for some pages like home page and render all other routes in standard angular way. I don't want to use server side rendering for private pages where…
Andzej Maciusovic
  • 4,306
  • 1
  • 29
  • 40
12
votes
1 answer

Angular Universal server rendering WebSocket

Are there any examples of Angular Universal with WebSockets? Serverside rendering does not know wat a WebSocket object is in my case. And if I use socket.io the node server hangs when trying to make a connections. Some additional information about…
Marco
  • 281
  • 1
  • 4
  • 8
11
votes
2 answers

Angular Universal Firebase: no provider for InjectionToken MODULE_MAP

Why do I get Error: StaticInjectorError(AppServerModule)[NgModuleFactoryLoader -> InjectionToken MODULE_MAP]: StaticInjectorError(Platform: core)[NgModuleFactoryLoader -> InjectionToken MODULE_MAP]: NullInjectorError: No provider for…
Phil
  • 7,065
  • 8
  • 49
  • 91
11
votes
2 answers

Angular Universal for dynamic content?

I want to use Angular Universal for two things: SEO and preview of the site on social media. I know it is possible with static site content. But what about dynamic content? What if I want search engines and social media crawlers to find not only the…
Phil
  • 7,065
  • 8
  • 49
  • 91
11
votes
2 answers

Angular 5 Universal wait for http request to return during server-side render

I have an Angular 5 app that is served using ngExpressEngine (Followed the Angular Universal starter project). My app has a component that makes a HTTP request to to get some data to be displayed. All works correctly but when I use fetch as google…
11
votes
5 answers

Server does not wait till http call completes before rendering - angular 4 server side rendering

I have gone ahead and implemented angular universal and able to render static part of html via server side rendering. Issue that I face is, API calls are being made and server is rendering the html without waiting for the http call to complete. So,…
Chan15
  • 929
  • 2
  • 9
  • 16
11
votes
2 answers

Using cookies in Universal Rendering using angular-cli

I have made an angular app using angular-cli and doing universal rendering in it by following steps given here . But it is mentioned that i can't use Global variables like window and document in my app if i am doing universal rendering, How can i…
Devesh Jadon
  • 7,004
  • 4
  • 22
  • 27
11
votes
2 answers

Server side rendering. Web API and Angular 2

I've developed a web application built using ASP.NET Core Web API and Angular 4. My module bundler is Web Pack 2. I would like to make my application crawlable or link sharable by Facebook, Twitter, Google. The url must be the same when some user…
StepUp
  • 36,391
  • 15
  • 88
  • 148
11
votes
1 answer

Authentication in angular 2 universal, nodejs

I downloaded universal-starter for nodejs and started migrating my website from old angular-rc4. But when I have to implement authentication (in my case it's JWT which is stored in localStorage), the server dont have localStorage and cookie so that…
user3027246
  • 233
  • 6
  • 13
10
votes
4 answers

An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID

When running ng deploy I get the following error: An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID See "C:\Users\theoh\AppData\Local\Temp\ng-Nv0wMh\angular-errors.log" for further details. The full log of the…
10
votes
3 answers

Angular Universal does not wait for api/http request before render

I have a brand new angular universal project that seems to pretender all the HTML (which is good). However, I am trying to make an API call to my .NET server which is a standard API build with the weatherforecast API. The API calls and it works…
Stanley
  • 2,434
  • 18
  • 28
10
votes
2 answers

Angular 8 Universal Build Failed on SCSS Imports

I am using AngularCLI and an Angular v8. In regards to Angular Universal, I have encountered an issue where after I run these commands which are the preparatory steps to setup: ng generate universal --clientProject npm install…
KShewengger
  • 7,853
  • 3
  • 24
  • 36