aspnetcore-angular-universal icon indicating copy to clipboard operation
aspnetcore-angular-universal copied to clipboard

Call to Node module failed with error: Prerendering timed out after 30000ms because the boot function in 'D:\\home\\site\\wwwroot/ClientApp/dist/main-server' returned a promise that did not resolve or reject.

Open SouravKumar89 opened this issue 6 years ago • 4 comments

`` routererror

Below is my Routing code - where while deploying in server the router is throwing the above(image) error if we are refreshing route other '/home' or '/' .

app-Routing.ts file-->


const appRoutes: Routes = [ { path: '', redirectTo: 'home', pathMatch: 'full', data: { name: 'home' } }, { path: 'home', component: HomeComponent, data: { name: 'home', title: 'Home' } }, { path: 'terms', loadChildren: './containers/terms/terms.module#TermsModule', data: { name: 'terms', title: 'Terms' } }, { path: 'policy', component: PolicyComponent,, data: { name: 'policy', title: 'Policy' } }]


I have implemented lazy loading also for some component as you can see. Every thing is working fine in Local but with AOT production it's running fine with router btn click navigation but not with refreshing any other page other than home page. my webpack version is-2.2.0 and "aspnet-webpack": "^2.0.1", Can anyone help me! is it lazy loading issue or something else!!

SouravKumar89 avatar Nov 22 '18 07:11 SouravKumar89

Hi I had a similar bug. Try increasing the timeout in class HttpRequestExtensions from 30000 to a higher value

nsaban avatar Dec 03 '18 15:12 nsaban

@nsaban - ok i'll try that.

SouravKumar89 avatar Dec 04 '18 06:12 SouravKumar89

i tried changing the httprequestExceptions to 100000ms but then it thrown this error-

Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException: The Node invocation timed out after 60000ms.\r\nYou can change the timeout duration by setting the InvocationTimeoutMilliseconds property on NodeServicesOptions.\n\nThe first debugging step is to ensure that your Node.js function always invokes the supplied callback (or throws an exception synchronously), even if it encounters an error. Otherwise, the .NET code has no way to know that it is finished or has failed.\r\n at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.<InvokeExportAsync>d__131.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.<InvokeExportWithPossibleRetryAsync>d__101.MoveNext()\r\n---

SouravKumar89 avatar Dec 04 '18 07:12 SouravKumar89

I also have similar problem. In my case I have lazy loading in routing and I'm adding sub routes children in the module using: @NgModule({ imports: [ RouterModule.forChild(routes) ], exports: [RouterModule] })

When I try to reload some of these lazy loaded children routes or hit directly in URL:

{"statusCode":500,"message":"Prerendering timed out after 30000ms because the boot function in '/ClientApp/dist/main-server' returned a promise that did not resolve or reject. Make sure that your boot function always resolves or rejects its promise. You can change the timeout value using the 'asp-prerender-timeout' tag helper.\r\n"}

My Microsoft.AspNetCore.All is version 2.2.0

GetTaxSolutions avatar Mar 12 '19 14:03 GetTaxSolutions