giraffe-fsharp / giraffe-template

A dotnet new template for Giraffe web applications.
Apache License 2.0
37 stars 22 forks source link

"Exited with error code 137" on Mac M1 MacOS 14.4 (23E214) when `dotnet watch run` #51

Closed toraritte closed 1 month ago

toraritte commented 3 months ago

No matter what dotnet new giraffe flags I use, the result is the same:

$ dotnet new giraffe -o WithTemplate
The template "Giraffe" was created successfully.

$ cd WithTemplate/
$ dotnet watch run
dotnet watch 🚀 Started
dotnet watch ❌ Exited with error code 137
dotnet watch ⏳ Waiting for a file to change before restarting dotnet...

Completely new to ASP.NET Core (and .NET in general), so I tried the tutorial on Get started with ASP.NET Core | Microsoft Learn, and it worked.

Then I did the manual approach, but that one worked too:

$ dotnet new sln -o ByHand
The template "Solution File" was created successfully.

$ cd ByHand
$ dotnet new web -lang "F#" -o src/ByHand
The template "ASP.NET Core Empty" was created successfully.

Processing post-creation actions...
Restoring /Users/toraritte/dev/shed/dotnet/giraffe/ByHand/src/ByHand/ByHand.fsproj:
  Determining projects to restore...
  Restored /Users/toraritte/dev/shed/dotnet/giraffe/ByHand/src/ByHand/ByHand.fsproj (in 1.09 sec).
Restore succeeded.

$ dotnet sln add src/ByHand/ByHand.fsproj 
Project `src/ByHand/ByHand.fsproj` added to the solution.

$ cd src/ByHand/
$ dotnet add package Microsoft.AspNetCore.App
$ dotnet add package Giraffe
  Determining projects to restore...
/usr/local/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(111,5): warning NETSDK1080: A PackageReference to Microsoft.AspNetCore.App is not necessary when targeting .NET Core 3.0 or higher. If Microsoft.NET.Sdk.Web is used, the shared framework will be referenced automatically. Otherwise, the PackageReference should be replaced with a FrameworkReference. [/Users/toraritte/dev/shed/dotnet/giraffe/ByHand/src/ByHand/ByHand.fsproj]

Opened up Program.fs, and pasted the "more functional way" example from https://giraffe.wiki/#doing-it-manually, then

$ dotnet watch run

Did I miss something in the README?

64J0 commented 2 months ago

Hi @toraritte, thanks for opening this issue.

I was not able to validate locally since I don't have a mac, but maybe this @dbrattli's PR will fix this problem (PR link).

One of the points mentioned in the PR description is:

  • Don't append .App to assembly name since that crashes when running on Mac
atouchot commented 1 month ago

Got that error code 137 on macos and .NET 6.0 too. The fix worked, thanks!