Resolving Missing Static Assets in the Native Blazor Report Viewer
Environment
| Product | Progress® Telerik® Reporting |
| Report Viewer | Native Blazor Report Viewer |
| Version | 20.2.26.1007 |
Description
On .NET 9 or later, an application that references Telerik.ReportViewer.BlazorNative version 20.2.26.1007 can fail to build with a missing static asset error. The diagnostic references a compressed output and a missing CSS source map, as in the following example:
The asset 'C:\Projects\BlazorApp\obj\Debug\net10.0\compressed\14jp1i84hx-{0}-2x8nbomfaf-2x8nbomfaf.gz' can not be found at any of the searched locations 'C:\Users\<user>\.nuget\packages\telerik.reportviewer.blazornative\20.2.26.1007\staticwebassets\css\reporting-blazor-viewer.css.map' and 'C:\Users\<user>\.nuget\packages\telerik.reportviewer.blazornative\20.2.26.1007\staticwebassets\css\reporting-blazor-viewer.css.map'.
The SDK may report the error from Microsoft.NET.Sdk.StaticWebAssets.Compression.targets. The missing input is reporting-blazor-viewer.css.map.
Separately, version 20.2.26.1007 lacks SVG export icons. The viewer displays missing icons, and requests to _content/Telerik.ReportViewer.BlazorNative/icons/export/, such as pdf.svg, return HTTP 404 responses. These missing SVGs do not cause build errors.
Cause
Version 20.2.26.1007 declares reporting-blazor-viewer.css.map as a static web asset but does not include the file.
.NET 9+ SDKs enable compression for static web assets by default, including source maps. This build step attempts to read the declared file and exposes the package mismatch.
Version 20.2.26.1007 does not declare the missing SVG files as package assets, so the SDK does not report an SVG build error. The viewer still requests the icons at runtime. The application must serve the SVG files at the expected URLs.
CSS Source Map Workarounds
The packaging issues will be fixed in the upcoming Telerik Reporting release. Until that release is available, apply one of the following temporary workarounds for the CSS source map. For missing SVG icons, apply the SVG icon workaround separately.
Workaround 1: Excluding the Source Map
This workaround removes the missing map from static web asset processing for the host application. It leaves the NuGet package cache unchanged.
-
Add the following item group directly inside the
<Project>element of the application project file. Keep the existing package references and other settings unchanged:xml<ItemGroup> <StaticWebAsset Remove="$(NuGetPackageRoot)telerik.reportviewer.blazornative\20.2.26.1007\staticwebassets\css\reporting-blazor-viewer.css.map" /> <StaticWebAssetEndpoint Remove="_content/Telerik.ReportViewer.BlazorNative/css/reporting-blazor-viewer.css*.map" /> </ItemGroup> -
Clean the application, rebuild it, and publish it again. Do not reuse previous build outputs for the first publish after this change.
In this case, the viewer CSS and JavaScript remain available. The map is not required for viewer functionality.
Workaround 2: Adding the Source Map
If you prefer to keep the asset, you can supply the source map file at the location that the package metadata expects. This workaround satisfies the existing asset declaration before the build processes static assets.
-
Download
css/reporting-blazor-viewer.css.mapfrom the NativeBlazorViewerAssets folder. Place the file atwwwroot/css/reporting-blazor-viewer.css.mapin the application. -
Add the following item group and target directly inside the
<Project>element of the application project file:xml<ItemGroup> <None Include="wwwroot\css\reporting-blazor-viewer.css.map" /> </ItemGroup> <Target Name="CopyReportingBlazorViewerCssMap" BeforeTargets="PreBuildEvent"> <MakeDir Directories="$(NuGetPackageRoot)telerik.reportviewer.blazornative\20.2.26.1007\staticwebassets\css" /> <Copy SourceFiles="$(MSBuildProjectDirectory)\wwwroot\css\reporting-blazor-viewer.css.map" DestinationFolder="$(NuGetPackageRoot)telerik.reportviewer.blazornative\20.2.26.1007\staticwebassets\css" SkipUnchangedFiles="true" /> </Target>The target uses
NuGetPackageRootrather than a hard-coded user profile. Ensure the build account can write to that directory. -
Clean the application and rebuild it.
The source map now exists at the path that the package declares.
SVG Icon Workaround
Keep replacement SVGs in the application rather than the shared NuGet cache. The application serves its own files at the URLs that the viewer expects. No project-file changes are required for the icons in version 20.2.26.1007.
To restore the export icons:
-
Download the
iconsfolder from the NativeBlazorViewerAssets folder. -
Copy that folder to
wwwroot/_content/Telerik.ReportViewer.BlazorNative/iconsin the application. Preserve theexportsubfolder and the SVG file names. The resulting structure is:textwwwroot/ _content/ Telerik.ReportViewer.BlazorNative/ icons/ export/ csv.svg docx.svg image.svg options.svg pdf.svg pptx.svg rtf.svg xlsx.svg -
Clean the application and rebuild.