Exception: Call to Node module failed with error: Prerendering timed out after 30000ms because the boot function in 'C:\Users\Matej\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master 3/Client/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.
What am i doing wrong? While RestAPI is working, the website is not loading :(
Is this from a Fresh repo, or were there updates that happened?
Can you check the output logs in VS to see what spits out there, there must be an error in the Templates/etc that's causing the server render to not complete. Let me know!
Most likely related to failed webpack build. Run npm run build:dev and/or? npm run build:aot to see if either spit out any errors. Or add in the two missing uncaught promise errors blocks to reject the promise in the aspnetcore-engine shim and the error from the failed build should show up in the browser rather than that 'very helpful' error message. :)
Finally added that in there, fixed via https://github.com/MarkPieszak/aspnetcore-angular2-universal/commit/355b99ef76c34e28c6f2ce391b77ace5f4893e80
@digibum Can you check that commit, either get latest, or add those missing error reject(err) lines to your engine, npm run build:dev and re-run your project, that'll help show you what the error is! (The error was already there in the output, but this helps make it bubble up to the browser now).
Thanks @kyse 馃憤 馃憤
Hopefully the aspnetcore engine github repo updates this. Try/catch doesn't work for rejecting promise chains, but this definitely needs to be reported to them before they go live or fix whatever prevented you from using their npm package rather than a shim.
Yeah I'll get that into the github repo as well as use the @nguniversal/ng-aspnetcore-engine instead of having it inside the repo here. I wrote the engine there, just had it temporarily in here for testing purposes. Think we figured out all the kinks with it so we can start using it!
This still isn't working and returning immediately with a proper error message to the browser so you still have to dig through a ton of debug crap in the console of your debugger to find out what's wrong.
As a simple test I just ran our site without our API being started so an http request would fail. It just hung and then dumped to the debug console instead of the browser eventually.
Most helpful comment
This still isn't working and returning immediately with a proper error message to the browser so you still have to dig through a ton of debug crap in the console of your debugger to find out what's wrong.
As a simple test I just ran our site without our API being started so an http request would fail. It just hung and then dumped to the debug console instead of the browser eventually.