Open hardware opened 2 years ago
@hardware I have the Same Issue. Have you found a solution?
For me it seemed that one of the target files had a typo, be mindful of the naming conventions specified in the readme and make sure the file names don't have any typos.
May this be the same error as mine? I am getting it locally (no docker or anything, just Visual Studio, .Net 5.0 and LigerShark.WebOptimizer.Core 3.0.335 + LigerShark.WebOptimizer.Sass 3.0.58-beta, no incompatibility error on install or build):
pipeline.AddScssBundle(
GetScssSettings(), // nothing relevant
"/css/bootstrap.css",
"/_wwwroot/bootstrap/scss/bootstrap.scss").UseContentRoot();
Bootstrap SCSS files are really in project-folder/_wwwroot/bootstrap/scss/bootstrap.scss
. Notice the _
, it is on a folder name named differently than wwwroot.
Then I include it as:
<link type="text/css" rel="stylesheet" href="css/bootstrap.css" />
But I get a similar exception stack (most significant parts for brevity)
An unhandled exception occurred while processing the request.
FileNotFoundException: No files found matching exist in an asset
WebOptimizer.Asset.ExpandGlobs(IAsset asset, IWebHostEnvironment env)
WebOptimizer.Taghelpers.LinkTagHelper.WriteIndividualTags(TagHelperOutput output, IAsset asset)
WebOptimizer.Taghelpers.LinkTagHelper.Process(TagHelperContext context, TagHelperOutput output)
Microsoft.AspNetCore.Razor.TagHelpers.TagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.RunAsync(TagHelperExecutionContext executionContext)
ElegiaWebsite.App.Pages.Shared.App_Pages_Shared__Layout.<ExecuteAsync>b__17_0() in _Layout.cshtml
...
Am I missing something? I can't find any typo for now. As an extra test, I did set every cache to false, but no luck.
@ezaca My recommendation would be to only include one library at time and test, for me it one of them had a typo and i found it when including library files iteratively.
I got this issue after updating LigerShark.WebOptimizer.Sass to 3.0.82-beta. I think it must also occur when it can't find a bundle file because after a bit of trial and error I found if I changed pipeline.AddScssBundle("css/site.css", ...
to pipeline.AddScssBundle("/css/site.css", ...
then it would work again.
Hello,
I can't understand the exception bellow when WebOptimizer's tag helper try to access any bundle after a deployment on an Azure App Service. Locally everything works as expected.
Exception details :
Line (_Layout.cshtml:35) :
Pipeline :
https://github.com/hardware/hitmanstat.us.v2/blob/assets/hitmanstat.us/Startup.cs
There must be something that prevents the taghelper from finding the right file after deployment but I can't figure out what. If I comment the
<link rel="stylesheet" href="/css/bundle.css" />
, an exception on the JS files is raised as well, if I remove@addTagHelper *, WebOptimizer.Core
in _ViewImports.cshtml, I got no exception but obviously the web browser can't find any CSS/JS asset.Does anyone have an idea?
LigerShark.WebOptimizer.Core 3.0.319 ASP.NET Core 5.0.11
App URL : https://hitmanstatus-pprod.azurewebsites.net/ App source code : https://github.com/hardware/hitmanstat.us.v2/tree/assets