RemiBou / Toss.Blazor

Experimental project using AspNetCore Blazor
MIT License
123 stars 30 forks source link

Window is blank after Blazor gets initialized #4

Closed Code-Chops closed 6 years ago

Code-Chops commented 6 years ago

I tried to run your project on my computer and followed all steps alls described:

run CosmosDB Emulator Edit Toss.Server secrets with your values using the empty-secrets.json provided Build Toss.Server Run Toss.Server

But the screen gets blank after "Welcome to TOSS". I don't see any error in the browser console and the last XHR I receive is Toss.Shared.pdb If I run it with Kestrel, the last log item is: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 831.4639ms 304 text/html

What is wrong?

Code-Chops commented 6 years ago

I still don't know what's the problem. Your application works on another system. I tried to run the app as a server-side Blazor app and the exception it throws is:

Exception thrown: 'System.InvalidOperationException' in System.Private.CoreLib.dll ("The SPA default page middleware could not return the default page '/index.html' because it was not found, and no other middleware handled the request. ") Exception thrown: 'System.InvalidOperationException' in System.Private.CoreLib.dll ("The SPA default page middleware could not return the default page '/index.html' because it was not found, and no other middleware handled the request. ")

on CsrfTokenCookieMiddleware line 28.

Does somebody know what is wrong?

RemiBou commented 6 years ago

I tried server side on this project (there is still a branch with it) but I couldn't figure out why it's not working. Even though client-side and server-side Blazor can run the same code, you don't have the same app architecture for both : one will rely heavily on http client (ajax) while the other one will use directly the services.

About your first error, I'll have a look, since you are running CosmosDB I guess you are on Windows ? Do you use IIS Express or Kestrel ?

Code-Chops commented 6 years ago

I used both IIS Express and Kestrel. I ran the same code on another system and it worked perfectly there. So it must have been something with my machine configuration. I tried to reinstall CosmosDB, but that didn't work.

Later on I uninstalled the .NET Core 2.2.* preview versions on my PC. That worked! But I still don't know exactly what went wrong.

This thread can be closed now :)

RemiBou commented 6 years ago

Thanks, I often have issues with Blazor forcing me to update sdk or vs. I'll try to dig it next time and post an issue. Thanks for letting me know.