経緯
Failed to find a valid digest in the 'integrity' attribute for resource 'domain/_framework/〇〇.dll' with computed SHA-256 integrity 'XXXXXXXXXXXXXXXX. The resource has been blocked.
上記のようなエラーがデプロイ環境で起きた。
ローカル環境は動くのに。
対応
下記サイトにあるように対応してうまくいった。
If was the issue, please try this:
- Close VS.
- Delete the
obj
andbin
folders from all your projects. (the web project might be enough, but hey - can't hurt)- Start VS
- Rebuild solution.
- Try Publish again.
削除したファイルはビルド時に再度生成される。
もっと細かく対応すると、blazor.boot.jsonのファイルを消す。
その中のファイルで先ほどのエラーの中のハッシュ化されたキー見つかる。
このファイルを消してあげてビルドするとうまく再生成され、デプロイがうまくいった。