question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

angular with universal getting error

See original GitHub issue

Hi, I am trying to angular with universal.

I refer this https://github.com/angular/angular-cli/wiki/stories-universal-rendering.

I build my app

using this command

npm run build:ssr

I trying to serve using this command

npm run serve:ssr

I am getting this error.

> Unhandled Promise rejection: renderModule[Factory]() requires the use of BrowserModule.withServerTransition() to ensure
> the server-rendered app can be properly bootstrapped into a client app. 

How can i fix this issue.

Kindly pls advice me,

Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
TomasKatzcommented, Nov 22, 2017

Resolved it by adding:

import { BrowserModule } from '@angular/platform-browser';
...
imports: [
      BrowserModule.withServerTransition({
          appId: 'ng-universal-demystified'
      })...
  ]

However the problem we are facing here is f**ing uploading an express-universal app to IIS, which proves to be non-trivial at all.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting error while executing angular universal app
After integrating all when I hit the "ng run Frontend:serve-ssr" command in a terminal, then I get the following error.
Read more >
How to handle Server and Client errors in Angular Universal ...
The problem​​ One of the main issues that arose when trying Angular Universal for one of my personal projects, was the inability to...
Read more >
Angular Universal: real app problems - InDepth.Dev
SSR issues in Angular · 1. Infinite page loading · 2. Lack of cache out of the box · 3. Server errors of...
Read more >
Angular Universal Plugin Error - Netlify Support Forums
Netlify site name: angular-universal.netlify.app When building using the netlify-plugin-angular-universal ... (in beta)) i'm getting the following error:
Read more >
Server-side rendering (SSR) with Angular Universal
Angular Universal executes on the server, generating static application pages that later get bootstrapped on the client. This means that the application ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found