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.
Ok, first question, do you have the line BrowserModule.withServerTransition() in your AppModule? Also, can you post the repo you're dealing with so we can take a closer look at it?
Have the same issue and dont have BrowserModule.withServerTransition() in my AppModule
@TomasKatz Do you have it somewhere? It needs to be somewhere in your application.
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.
@TomasKatz Your issue is being tracked by https://github.com/angular/universal/issues/769
Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular-cli.
If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.
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._
Most helpful comment
Resolved it by adding:
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.