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.

The prerendering build process did not complete within the timeout period of 50 seconds.

See original GitHub issue

Describe the bug

When I upgrade to Angular 8,and run the spa project on ssr mode,it thorw the timeout exception:

The prerendering build process did not complete within the timeout period of 50 seconds.

To Reproduce

Steps to reproduce the behavior:

  1. Using this version of ASP.NET Core 2.2
  2. Using Angular Template and upgrade the angular version to 8.0
  3. Run the project on SSR mode.
  4. See error
  5. Remove the AngularCliBuilder,build the ssr bundles with angular-cli and it work…

my ssr options:

            app.UseSpa(spa =>
            {
                spa.Options.SourcePath = "ClientApp";

                spa.UseSpaPrerendering(options =>
                {
                    options.BootModulePath = $"{spa.Options.SourcePath}/dist/server/main.js";
                    options.BootModuleBuilder = env.IsDevelopment()
                        ? new AngularCliBuilder(npmScript: "build:ssr")
                        : null;

                    options.ExcludeUrls = new[] { "/sockjs-node" };
                    options.SupplyData = (context, data) =>
                    {
                        data.Add("Cookies", context.Request.Cookies);
                    };
                });

                if (env.IsDevelopment())
                {
                    //spa.UseAngularCliServer(npmScript: "start");
                    spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");
                }
            });

Expected behavior

Screenshots

If applicable, add screenshots to help explain your problem.

image

Additional context

output of dotnet --info

.NET Core SDK(反映任何 global.json):
 Version:   3.0.100-preview4-011223
 Commit:    118dd862c8

运行时环境:
 OS Name:     Windows
 OS Version:  10.0.18362
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview4-011223\

Host (useful for support):
  Version: 3.0.0-preview4-27615-11
  Commit:  ee54d4cbd2

.NET Core SDKs installed:
  2.2.204 [C:\Program Files\dotnet\sdk]
  3.0.100-preview4-011223 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview4-19216-03 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview4-27615-11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview4-27613-28 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
esoderquistcommented, Jul 5, 2019

Just ran into this myself during an Angular 8 upgrade. It appears the output of the SSR build process no longer contains output matching the Regex(“Date”) as required by https://github.com/aspnet/AspNetCore/blob/7269dbb73f4aa0ebf5ebb8bc07a076ee181851be/src/Middleware/SpaServices.Extensions/src/AngularCli/AngularCliBuilder.cs#L65

Under Angular 8, my build:ssr output is as follows (this is based on output generated by @angular-devkit/build-angular:server):

Hash: 7ed827808cf36ae1a2bc
Time: 17502ms
Built at: 07/05/2019 2:41:31 PM
  Asset      Size  Chunks                    Chunk Names
main.js  10.9 MiB    main  [emitted]  [big]  main
Entrypoint main [big] = main.js
chunk {main} main.js (main) 10.6 MiB [entry] [rendered]

However, the browser build still contains the string “Date”:

chunk {main} main.js, main.js.map (main) 189 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 388 kB [initial] [rendered]
chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 474 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 8.99 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 6.74 kB [entry] [rendered]
chunk {styles} styles.css, styles.css.map (styles) 248 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 7.06 MB [initial] [rendered]
Date: 2019-07-05T22:32:03.642Z - Hash: 8114fd85771536983b1f - Time: 20299ms

@ElderJames @JasonBro My extremely naive workaround for now is to append an “echo Date” to the end of my build:ssr script definition in package.json, e.g.:

"build:ssr": "ng build --configuration=production --project=test-spa-ssr && echo Date",

This works around the issue for me.

1reaction
papiliondcommented, Sep 17, 2019

Any progress in this issue? esoderquist’s workaround works, but does not seem to be a durable solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.Net MVC Core: The prerendering build process did ...
TimeoutException : The prerendering build process did not complete within the timeout period of 50 seconds. Check the log output for error ...
Read more >
The Angular CLI process did not start listening for requests ...
TimeoutException : The Angular CLI process did not start listening for requests within the timeout period of 50 seconds.
Read more >
Can I use asp.net core 3.1 with angualr 11
[Note] You might meet the "The Angular CLI process did not start listening for requests within the timeout period of 0 seconds.
Read more >
The Angular CLI process did not start listening for requests ...
Complete list of page response is : TimeoutException: The Angular CLI process did not start listening for requests within the timeout period of...
Read more >
[Fix]-The Angular CLI process did not start listening for requests ...
Net MVC Core: The prerendering build process did not complete within the timeout period of 50 seconds · Exception: In process hosting is...
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