Fail to build when using dotnet spa templates
See original GitHub issueI use the angular template of https://github.com/aspnet/templating, but electronizing it fails. The dotnet publish fails at the last step trying to build the SPA
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
<DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
Doing the ng build
upfront and commenting the above part out of the csproj, makes it work perfectly. So there must be something going on with the publish function being called during start.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (1 by maintainers)
Top Results From Across the Web
docker - .Net core angular template dockerfile error
I am trying to create an image using the .net core angular spa template in visual studio 2017. I keep receiving the npm...
Read more >Overview of Single Page Applications (SPA) in ASP.NET ...
The Single Page Application (SPA) templates for Angular and React offer the ability to develop Angular and React apps that are hosted inside ......
Read more >SPA Angular template publish failure
I have built the application as follows: >dotnet new angular >npm install a) installed Ms.ASPNETCore.Server.IISIntegration
Read more >blazor template can't build on cli
Hello dotnet new build blazor creates project. ... Error: rzc generate exited with code 1. ... blazor template can't build on cli.
Read more >ASP.NET SPA Templates Proxy Changes from .NET 5 ... - InfoQ
After all the changes, build and run the application. Both Angular and React versions should follow the new proxy strategy and have HTTPS ......
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 FreeTop 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
Top GitHub Comments
hello … I’m having the same issue. I follow the tutorial https://www.youtube.com/watch?v=nuM6AojRFHk that says that we should use the SPA but the example is with a MVC and Controllers … the SPA return this strange error.
Can you please make a tutorial with SPA or tell us how to create this… please!!!
Paulo Aboim Pinto
I just found these lines in the source code. https://github.com/ElectronNET/Electron.NET/blob/c1bd48b58de773967ca01b60407e6dc6ef10f9fa/ElectronNET.CLI/ProcessHelper.cs#L47-L50 Sorry to say but that’s unfortunately a naive way of interpreting the output. The build output of Angular does contain that word, because it has error handlers. It sure sounds like that’s the reason it fails…there must be another way to check for the actual exitcode.