Closed DrTekno closed 2 years ago
If you're on the latest version of BlazorSize you don't need the script tag. The latest version imports the script using modual imports.
Does this error occur normally? Is that why you're adding the script?
Please make sure you have the service added to DI, and a MediaQueryList component at the root level.
Yes i've added '.AddMediaQueryService()' to DI, and 'MediaQueryList' component at the root level but without the script tag i've this error
I've also add using BlazorPro.BlazorSize to _Import.razor and i'm testing like this
@if (IsSmall)
{
<p>YES IS SMALL</p>
}
else
{
<p>NOT SMALL</p>
}
<MediaQuery Media="@Breakpoints.SmallDown" @bind-Matches="IsSmall" />
@code {
bool IsSmall = false;
}
to check if is working
Any chance you can share a complete project or sample that has this issue?
The project is quite complex and i have finally found another solution but aniway thank you for your suggestions.
@EdCharbeneau I'm currently facing the same issue when trying to use BlazorSize. I have some other custom packages that are also raising this type of error after migrating to .NET 6.0.
Haven't solved the issue myself yet, but here is some useful info I've found so far:
What I can't figure out is when this happens to a very specific minority of users. If you download the .nupkg file and rename it to .zip, you'll see that the required JavaScript assets are included where they belong.
@EdCharbeneau for me it's working fine while debugging. But after publishing I get the same error as @juangallostra.
@EdCharbeneau release 6.1.2 fixed the problem for me. I was testing locally on windows (had no problems) but deploying from a Docker Image running Linux (related to #73).
@juangallostra thanks for following up
I've installed 6.1.2 and am getting this error. I can see the staticwebfiles in the nuget package but they're not being deployed on publish
Can you double check this in your server's build process please? https://docs.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-6.0#serve-files-in-web-root
Can you double check this in your server's build process please? https://docs.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-6.0#serve-files-in-web-root
Yes, this is definitely included
The only difference with this app is that it's a .NET 5 app upgraded to a .NET 6 app but still has separate Startup and Program files.
This issue was originally caused by Linux systems because they are case sensitive. One of the JavaScript files used an uppercase character in the file, but lower case in the C# codebase. The issue was fixed in 6.1.2.
Is there any way you're caching an old version? or the server is on a different version?
Is the server Linux?
This issue was originally caused by Linux systems because they are case sensitive. One of the JavaScript files used an uppercase character in the file, but lower case in the C# codebase. The issue was fixed in 6.1.2.
Is there any way you're caching an old version? or the server is on a different version?
Is the server Linux?
Hi Ed, no, running on Windows. Same issue occurs on live app service and staging deployment slot.
Environment:
WASM and .NET6. Debugging : updated Chrome and VSCode.
Problem
I have MediaQueryList always null so i have added
<script src="_content/BlazorPro.BlazorSize/blazorSize.js"></script>
to my '.cshtml' file but still the file cant be found.My question is : Should the file be generated in the bin when build the application? Because is not my case and i've seen is hard coded here: https://github.com/EdCharbeneau/BlazorSize/blob/net6/BlazorSize/MediaQuery/MediaQueryService.cs#L16
Thanks