Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor app doesn't load after upgrade to 3.0-preview4/preview5 #10578

Closed
vova-lantsov-dev opened this issue May 28, 2019 · 14 comments
Closed

Blazor app doesn't load after upgrade to 3.0-preview4/preview5 #10578

vova-lantsov-dev opened this issue May 28, 2019 · 14 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components question

Comments

@vova-lantsov-dev
Copy link

I have latest extension installed from here. Also VS 2019 16.2.0 Preview 1.0 installed. Code migrated from 0.7.0 using official migration guide.

My app can't load. Only router exists inside <app>.
image

Nothing useful in console
image

Debugging gives me no information at all
image

My project is available here (branch called feature-blazor-3.0.0-preview4)

Please help me determine what goes wrong. I added some logging inside OnInit(Async) methods of my pages, but they're never called. I tried to play with Startup file of Server project, but nothing changed.

dotnet --info output:

Пакет SDK для .NET Core (отражающий любой global.json):
 Version:   3.0.100-preview5-011568
 Commit:    b487ff10aa

Среда выполнения:
 OS Name:     Windows
 OS Version:  10.0.17134
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview5-011568\

Host (useful for support):
  Version: 3.0.0-preview5-27626-15
  Commit:  61f30f5a23

.NET Core SDKs installed:
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.700 [C:\Program Files\dotnet\sdk]
  2.1.800-preview-009677 [C:\Program Files\dotnet\sdk]
  2.2.300 [C:\Program Files\dotnet\sdk]
  3.0.100-preview5-011568 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.11 [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.11 [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-preview5-19227-01 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview5-27626-15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview5-27626-15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label May 28, 2019
@3x0dv5
Copy link

3x0dv5 commented May 29, 2019

looks like you project has a few things that you might need to fix.

Couple of things I did:
image

Maybe it would be a good idea to put a _Imports.razor in the root folder next to the App.razor with the minimum contents like:

@using Microsoft.AspNetCore.Components
@using Microsoft.AspNetCore.Components.Routing

you entry page seems to be referring to a class that doesn't seem to exist
image

then in the browser's console you can see a bunch of errors
image

That file BookkeepingNasheDetstvo.Client.Components.ForButtons.Button.razor, try call it something else. Something that doesn't conflict with an html tag when converted to lowercase, not sure if this is a known issue in Razor, I actually always call new components something like MyPrefixComponent.razor

In your InputDateComponent.razor you have a <Button> and that is causing a lot of the errors in the browser, I commented the line and was able to see stuff.
image

I managed to see something on the screen.
image

Anyways, hope this helps you in any way.

@3x0dv5
Copy link

3x0dv5 commented May 29, 2019

Actually ignore the SubjectModal part, that seems to be a bug in my Resharper.
Although you might be missing the @inherits in the SubjectModal.razor
image

But you need an if check in your subjects.razor.
image

@danroth27
Copy link
Member

Thanks @3x0dv5 for helping out here!

@vova-lantsov-dev I'm hoping the pointers from @3x0dv5 are enough to get you unblocked. If you're still hitting issues that you think are problems we need to address in Blazor please let us know!

@vova-lantsov-dev
Copy link
Author

@3x0dv5 for subjects.razor there is @inherits in _Imports.razor

After changing .csproj file to what you showed it still does not work
image

Application is running well but not responding at all.
image

I also commented DateInputComponent

@vova-lantsov-dev
Copy link
Author

Can you please create PR to my repo so I can try to make things work?

@vova-lantsov-dev
Copy link
Author

@3x0dv5 and also tell me your VS, .NET Core SDK and Blazor extension versions. I'd like to compare them with mine

@vova-lantsov-dev
Copy link
Author

I found the same issue from 2018: https://github.com/aspnet/Blazor/issues/307

@vova-lantsov-dev
Copy link
Author

Also some exception from Output tab
image

@vova-lantsov-dev
Copy link
Author

@danroth27 , any suggestion? Is VS 2019 16.2.0 Preview 1.0 supported? According to issue I sent above, there should be a problem with Razor compiler.

@danroth27
Copy link
Member

@vova-lantsov-dev Yes, VS2019 16.2 Preview 1 should be fine. Let me take a quick look at your repo.

@vova-lantsov-dev
Copy link
Author

@danroth27 I can also give you remote access to my PC so you can take a look there

@danroth27
Copy link
Member

danroth27 commented May 31, 2019

@vova-lantsov-dev I sent you a PR that gets the initial page to render: vova-lantsov-dev/bookkeeping-blazor#4. The tricky issue that had me stumped for a bit was that the initial page wasn't rendering because the namespace was missing for the Router component in App.razor. This problem will become easier to diagnose once we fix #9860. I'm sure there's more stuff to fix up, but hopefully this will get you unblocked.

@vova-lantsov-dev
Copy link
Author

vova-lantsov-dev commented May 31, 2019

@danroth27 thank you, now it makes sense. I also know that there is an issue that components are not visible when usings are declared in _Imports.razor . Is it already reported or I should create new issue?

@danroth27
Copy link
Member

I also know that there is an issue that components are not visible when usings are declared in _Imports.razor . Is it already reported or I should create new issue?

That's expected. Layouts in Blazor are components defined by their own class. So using statements in the layout won't flow into individual pages. To propagate using statements across components you should use _Imports.razor.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components question
Projects
None yet
Development

No branches or pull requests

4 participants