microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications
https://www.fluentui-blazor.net
MIT License
3.68k stars 351 forks source link

fix: Warning 'Initializer will be ignored ...' in browser console #2502

Closed JarJasAskom closed 1 month ago

JarJasAskom commented 1 month ago

Fluent UI 4.9.3. Blazor server mode. No prerendering, no SSR, no Webasembly.

All browsers. Warning in the browser console:

blazor.web.js:1 [2024-08-09T08:02:49.573Z] Warning: Initializer 'http://localhost:5067/_content/Microsoft.Fast.Components.FluentUI/Microsoft.Fast.Components.FluentUI.lib.module.js' will be ignored because multiple runtimes are available. use 'before(web|webAssembly|server)Start' and 'after(web|webAssembly|server)Started?' instead.)

Fluent UI seems to work fine. But it would be nice to get rid of this warning.

vnbaaij commented 1 month ago

As this does not happen normally, please provide reproduction code. Have you included the script manually? What other changes have you made? How does the solution/project structure look like?

JarJasAskom commented 1 month ago

The warning starts to appear after adding nuget package Microsoft.Fast.Components.FluentUI.DataGrid.EntityFrameworkAdapter.

Create empty blazor project, add Fluent UI, add Microsoft.Fast.Components.FluentUI.DataGrid.EntityFrameworkAdapter.

Info about this package:

https://learn.microsoft.com/en-us/fluent-ui/web-components/integrations/blazor#use-the-datagrid-component-with-ef-core

vnbaaij commented 1 month ago

That is not the correct package. You are installing the v3 Datagrid adapter while using the v4 library. Look at the instructions on the Datagrid page in the demo site to install the correct version (starting with Microsoft.FluentUI.AspNetCore.Components)

Don't use the learn site for that information Always use our own demo site (https://www.fluentui-blazor.net)

JarJasAskom commented 1 month ago

After adding the correct package there is no warning.

Thank you for you help!