You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an application made with the default Blazor template.
In this application, we have the default Counter and Weather pages.
We only added FluentUI, some styling, and a test project using xUnit and bUnit.
When building the solution everything is OK, but when running the unit tests we get this error:
Cannot provide a value for property 'LibraryConfiguration' on type 'Microsoft.FluentUI.AspNetCore.Components.FluentButton'.
There is no registered service of type 'Microsoft.FluentUI.AspNetCore.Components.LibraryConfiguration'.
Something similar was reported in #2425 and that issue should have been solved in v4.9.3.
We're now using v4.9.3 but we still get this error.
Failed Foo.Client.Tests.CounterPageTests.IncrementButtonShouldIncreaseCounter [405 ms]
Error Message:
System.InvalidOperationException : Cannot provide a value for property 'LibraryConfiguration' on type 'Microsoft.FluentUI.AspNetCore.Components.FluentButton'. There is no registered service of type 'Microsoft.FluentUI.AspNetCore.Components.LibraryConfiguration'.
Stack Trace:
at Microsoft.AspNetCore.Components.ComponentFactory.<>c__DisplayClass9_0.<CreatePropertyInjector>g__Initialize|1(IServiceProvider serviceProvider, IComponent component)
at Microsoft.AspNetCore.Components.ComponentFactory.InstantiateComponent(IServiceProvider serviceProvider, Type componentType, IComponentRenderMode callerSpecifiedRenderMode, Nullable`1 parentComponentId)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, Int32 frameIndex, Int32 parentComponentId)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
--- End of stack trace from previous location ---
at Bunit.Rendering.TestRenderer.AssertNoUnhandledExceptions() in /_/src/bunit.core/Rendering/TestRenderer.cs:line 629
at Bunit.Rendering.TestRenderer.Render[TResult](RenderFragment renderFragment, Func`2 activator) in /_/src/bunit.core/Rendering/TestRenderer.cs:line 480
at Bunit.Rendering.TestRenderer.RenderFragment(RenderFragment renderFragment) in /_/src/bunit.core/Rendering/TestRenderer.cs:line 101
at Bunit.Extensions.TestContextBaseRenderExtensions.RenderInsideRenderTree(TestContextBase testContext, RenderFragment renderFragment) in /_/src/bunit.core/Extensions/TestContextBaseRenderExtensions.cs:line 43
at Bunit.Extensions.TestContextBaseRenderExtensions.RenderInsideRenderTree[TComponent](TestContextBase testContext, RenderFragment renderFragment) in /_/src/bunit.core/Extensions/TestContextBaseRenderExtensions.cs:line 23
at Bunit.TestContext.Render[TComponent](RenderFragment renderFragment) in /_/src/bunit.web/TestContext.cs:line 68
at Bunit.TestContext.RenderComponent[TComponent](Action`1 parameterBuilder) in /_/src/bunit.web/TestContext.cs:line 54
at Foo.Client.Tests.CounterPageTests.IncrementButtonShouldIncreaseCounter() in D:\Data\a7\621\s\src\Foo.Client.Tests\CounterPageTests.cs:line 22
--- End of stack trace from previous location ---
💻 Repro or Code Sample
🤔 Expected Behavior
When using Microsoft.FluentUI.AspNetCore.Components v4.9.1 we don't get this error.
We expect our code to run with the latest version of Microsoft.FluentUI.
If we need to change our code we expect a detailed explanation what to change.
💁 Possible Solution
I don't have a fix, but I expect a similar fix as done for #2425 needs to be done.
🔦 Context
We use floating version so we always use the latest versions of the packages. For Microsoft.FluentUI we now need to pin the version on 4.9.1 to get is working again.
🌍 Your Environment
OS & Device: [e.g. MacOS, iOS, Windows, Linux] on [iPhone 7, PC]
Browser [e.g. Microsoft Edge, Google Chrome, Apple Safari, Mozilla FireFox]
.NET and Fluent UI Blazor library Version [e.g. 8.0.2 and 4.4.1]
We experience this issue locally on our Window pc with Visual Studio v17.10 and also on our Azure Build Agent (Windows).
The text was updated successfully, but these errors were encountered:
Since version 4.9.2, we've added a configuration to manage JavaScript loading. See #2388
In your unit tests, you must inject this LibraryConfiguration service:
🐛 Bug Report
We have an application made with the default Blazor template.
In this application, we have the default Counter and Weather pages.
We only added FluentUI, some styling, and a test project using xUnit and bUnit.
When building the solution everything is OK, but when running the unit tests we get this error:
Something similar was reported in #2425 and that issue should have been solved in v4.9.3.
We're now using v4.9.3 but we still get this error.
Our dependencies:
The full exception:
💻 Repro or Code Sample
🤔 Expected Behavior
When using Microsoft.FluentUI.AspNetCore.Components v4.9.1 we don't get this error.
We expect our code to run with the latest version of Microsoft.FluentUI.
If we need to change our code we expect a detailed explanation what to change.
💁 Possible Solution
I don't have a fix, but I expect a similar fix as done for #2425 needs to be done.
🔦 Context
We use floating version so we always use the latest versions of the packages. For Microsoft.FluentUI we now need to pin the version on 4.9.1 to get is working again.
🌍 Your Environment
We experience this issue locally on our Window pc with Visual Studio v17.10 and also on our Azure Build Agent (Windows).
The text was updated successfully, but these errors were encountered: