dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.36k stars 9.99k forks source link

Debugging BlazorWebAssembly #21396

Closed PavanDhariwal closed 4 years ago

PavanDhariwal commented 4 years ago

When installing a progressive web app during debug, the following error is displayed on the next run.

An unhandled error has occured. Reload.

Installed following these steps https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-release-candidate-now-available/. Visual Studio 2019 16.6 Preview

Steps to repoduce

  1. Create a new Blazor Web Assembly project as a progressive web app
  2. Build and debug under 'BlazorWebAssembly' option
  3. Once the app has loaded, click the plus symbol in the address bar and install app. This will install and then reopen as a PWA
  4. Stop your debug session
  5. Try to debug again either via the play button, f5 or the debug menu in Visual Studio 2019
  6. Error is displayed and the app doesn't load.

There is no way to uninstall the app. Clicking uninstall the app takes you to programs and features, where it is not displayed to uninstall.

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Further technical details

PavanDhariwal commented 4 years ago

Just to add to this. You can delete the app from here but has no effect on running it.

C:\Users{username}\AppData\Local\Temp

C:\Users{username}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Chrome Apps

mkArtakMSFT commented 4 years ago

Thanks for contacting us. This is not something we've seen in the past. If you have a small repro we'd be interested in looking into it.

ghost commented 4 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

PavanDhariwal commented 4 years ago

Thanks for contacting us. This is not something we've seen in the past. If you have a small repro we'd be interested in looking into it.

Sure. Attached. DRA_Blazor.zip

captainsafia commented 4 years ago

@PavanDhariwal It looks like the reproduction project you provided isn't a PWA. Perhaps you attached the incorrect file?

I went ahead and created a PWA app and wasn't able to repro the issue you saw. If you can provide:

ghost commented 4 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

PavanDhariwal commented 4 years ago

Hey,

Apologies, I uploaded the wrong project. Please see attached and follow steps in original post.

Thanks,

Pavan BlazorWebAssembly.zip

captainsafia commented 4 years ago

@PavanDhariwal Is the error that you refer to in your issue the on that is thrown in the console?

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Microsoft.AspNetCore.Components.Forms.InputTextArea requires a cascading parameter of type EditContext. For example, you can use Microsoft.AspNetCore.Components.Forms.InputTextArea inside an EditForm.
System.InvalidOperationException: Microsoft.AspNetCore.Components.Forms.InputTextArea requires a cascading parameter of type EditContext. For example, you can use Microsoft.AspNetCore.Components.Forms.InputTextArea inside an EditForm.
  at Microsoft.AspNetCore.Components.Forms.InputBase`1[TValue].SetParametersAsync (Microsoft.AspNetCore.Components.ParameterView parameters) <0x2cb8710 + 0x00056> in <filename unknown>:0 

If so, this is related to the use of the InputTextArea component in your Index.razor file. The docs have more information on how to use that component.

Removing the buggy code mentioned above, I am able to debug in both the browser and the PWA container.

PavanDhariwal commented 4 years ago

I can indeed confirm I am an idiot :-).