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 Preview 3 Breaking Change [Bug] #67

Closed
geersjake opened this issue Apr 2, 2020 · 1 comment
Closed

Blazor Preview 3 Breaking Change [Bug] #67

geersjake opened this issue Apr 2, 2020 · 1 comment
Labels
Bug Something isn't working Resolved: Won't Fix The reported behaviour will not be changed.

Comments

@geersjake
Copy link

Describe the bug
Upgrading a Blazor project with LocalStorage from preview 2 to preview 3, specifically Microsoft.AspNetCore.Components.WebAssembly 3.2.0-preview2.20160.5 to 3.2.0-preview3.20168.3 breaks Local Storage. This seems to be a services issue.

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] blazor.webassembly.js:1:36074
Unhandled exception rendering component: Cannot consume scoped service 'Blazored.LocalStorage.ILocalStorageService' from singleton {nameOfMySingleton}

To Reproduce

  1. Create a Blazor preview 3 project using the template (WebAssembly ASP NET hosted)
  2. Implement Blazored.LocalStorage (I tried v2.1.1 and 2.5.0)
  3. See error
@geersjake geersjake added Bug Something isn't working Triage Issue needs to be triaged labels Apr 2, 2020
@chrissainty
Copy link
Member

chrissainty commented Apr 2, 2020

Hi @geersjake, thanks for raising this.

The issue you're seeing is the result of a bug fix rather than a bug being created. You shouldn't have been able to use a scoped service in a singleton but that was being allowed to happen. As you can see for the error, that has now been fixed. Just to be clear, this is a fix in Blazor, there have been no changes in this library.

In order to fix this, you need to change the scope of your service which is consuming the ILocalStorageService to scoped.

I'm going to go ahead and close this issue as there isn't any work for us to do.

@chrissainty chrissainty added Resolved: Won't Fix The reported behaviour will not be changed. and removed Triage Issue needs to be triaged labels Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Resolved: Won't Fix The reported behaviour will not be changed.
Projects
None yet
Development

No branches or pull requests

2 participants