Skip to content
Latchkey

Blazor Server "blazor.web.js / blazor.server.js not found" at build in CI

A Blazor app references _framework/blazor.web.js (or blazor.server.js). These are produced by the static web assets pipeline at build/publish. If that pipeline did not run in CI, the script is absent from the publish output.

What this error means

Publish output is missing _framework/blazor.web.js (or blazor.server.js), or a later validation step reports the framework script path is not found after build.

dotnet
error : Static web asset '_framework/blazor.web.js' was not found in the
publish output. The StaticWebAssets build target may not have run.

Common causes

Build skipped the static web assets target

Calling a low-level compile path or copying bin/ directly bypasses the static web assets target that emits the framework scripts.

Publishing the wrong project in the solution

CI published a class library or the wrong app project, so the host project that emits _framework scripts was never built for output.

How to fix it

Publish the web project so static assets build

  1. Target the host web project explicitly in dotnet publish.
  2. Use publish (not a raw file copy) so the static web assets target runs.
  3. Verify _framework scripts exist in the output.
Terminal
dotnet publish ./src/WebApp/WebApp.csproj -c Release -o ./publish
test -f ./publish/wwwroot/_framework/blazor.web.js

Do not copy bin output as the deploy artifact

Use the publish output as the artifact so the assembled _framework scripts are included.

.github/workflows/ci.yml
- uses: actions/upload-artifact@v4
  with:
    path: ./publish

How to prevent it

  • Always deploy dotnet publish output, not raw bin/.
  • Publish the correct host project in a multi-project solution.
  • Add a check that framework scripts exist before deploy.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →