`-no-build-nodejs` without `/p:SkipTestBuild=true` fails build
See original GitHub issueI accidentally hit this in #21487. See https://dev.azure.com/dnceng/public/_build/results?buildId=974989 for example. The following errors occur in that build
/datadisks/disk1/workspace/_work/1/s/.dotnet/sdk/6.0.100-preview.1.21073.4/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(258,5): error MSB3954: Failed to compute hash for file '/datadisks/disk1/workspace/_work/1/s/src/Components/Web.JS/dist/Release/blazor.webassembly.js' because it does not exist or is inaccessible. [/datadisks/disk1/workspace/_work/1/s/src/Components/WebAssembly/testassets/StandaloneApp/StandaloneApp.csproj]
/datadisks/disk1/workspace/_work/1/s/.dotnet/sdk/6.0.100-preview.1.21073.4/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(258,5): error MSB3954: Failed to compute hash for file '/datadisks/disk1/workspace/_work/1/s/src/Components/Web.JS/dist/Release/blazor.webassembly.js' because it does not exist or is inaccessible. [/datadisks/disk1/workspace/_work/1/s/src/Components/WebAssembly/testassets/Wasm.Authentication.Client/Wasm.Authentication.Client.csproj]
/datadisks/disk1/workspace/_work/1/s/.dotnet/sdk/6.0.100-preview.1.21073.4/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(258,5): error MSB3954: Failed to compute hash for file '/datadisks/disk1/workspace/_work/1/s/src/Components/Web.JS/dist/Release/blazor.webassembly.js' because it does not exist or is inaccessible. [/datadisks/disk1/workspace/_work/1/s/src/Components/WebAssembly/testassets/HostedInAspNet.Client/HostedInAspNet.Client.csproj]
/datadisks/disk1/workspace/_work/1/s/.dotnet/sdk/6.0.100-preview.1.21073.4/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(258,5): error MSB3954: Failed to compute hash for file '/datadisks/disk1/workspace/_work/1/s/src/Components/Web.JS/dist/Release/blazor.webassembly.js' because it does not exist or is inaccessible. [/datadisks/disk1/workspace/_work/1/s/src/Components/WebAssembly/testassets/CustomBasePathApp/CustomBasePathApp.csproj]
/datadisks/disk1/workspace/_work/1/s/.dotnet/sdk/6.0.100-preview.1.21073.4/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(258,5): error MSB3954: Failed to compute hash for file '/datadisks/disk1/workspace/_work/1/s/src/Components/Web.JS/dist/Release/blazor.webassembly.js' because it does not exist or is inaccessible. [/datadisks/disk1/workspace/_work/1/s/src/Components/benchmarkapps/Wasm.Performance/TestApp/Wasm.Performance.TestApp.csproj]
/datadisks/disk1/workspace/_work/1/s/.dotnet/sdk/6.0.100-preview.1.21073.4/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(258,5): error MSB3954: Failed to compute hash for file '/datadisks/disk1/workspace/_work/1/s/src/Components/Web.JS/dist/Release/blazor.webassembly.js' because it does not exist or is inaccessible. [/datadisks/disk1/workspace/_work/1/s/src/Components/test/testassets/GlobalizationWasmApp/GlobalizationWasmApp.csproj]
/datadisks/disk1/workspace/_work/1/s/.dotnet/sdk/6.0.100-preview.1.21073.4/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(258,5): error MSB3954: Failed to compute hash for file '/datadisks/disk1/workspace/_work/1/s/src/Components/Web.JS/dist/Release/blazor.webassembly.js' because it does not exist or is inaccessible. [/datadisks/disk1/workspace/_work/1/s/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj]
The problem is the test assets projects attempt to use the Release version of blazor.webassembly.js which (because of -no-build-nodejs) doesn’t exist. Options include
- Fail fast (with a much clearer error message) when those projects attempt to build and blazor.webassembly.js doesn’t exist
- Fall back to the Debug version of the file (which is checked in) when the Release version doesn’t exist
Thoughts @dotnet/aspnet-blazor-eng❔
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
NPM install fails with node-gyp
I tried several days for this build issue, on my PC with Visual Studio 2010 / 2013 / 2015 installed, with no success....
Read more >Node.js build fails with no obvious error - Windows
I have a build using Node.js on Windows and it errors out immediately after nvs use but there's no obvious error.
Read more >Troubleshooting Node.js Deploys
Your Node.js deploy failed, now what? Start with these steps to troubleshoot a build issue. Check the Buildpack.
Read more >Errors | Node.js v20.5.1 Documentation
System errors triggered by underlying operating system constraints such as attempting to open a file that does not exist or attempting to send...
Read more >Best Practices for Node.js Error-handling
Developers working with Node.js sometimes find themselves writing not-so-clean code while handling all sorts of errors. This article will introduce you to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

After some offline discussion, we’re going with the “fail fast” option because there is no checked-in blazor.webassembly.js file anymore. Specifically, I’ll add an
<Error>if Microsoft.AspNetCore.Components.WebAssembly.csproj is packed and a<Warning>if any$(UsingMicrosoftNETSdkBlazorWebAssembly)(test) project is built when the file doesn’t exist.I’ll also change the Microsoft.AspNetCore.Web.JS.npmproj project to use
$(Configuration)instead ofreleasebecause that’s what dependant projects consume.5923818afcb8