SAFE-template icon indicating copy to clipboard operation
SAFE-template copied to clipboard

Following Quick Start guide fails to start API server

Open brokenthorn opened this issue 2 months ago • 7 comments

Hello!

I am trying SAFE for the very first time and I have problems getting the default quick start template to run correctly as is explained. It seems like the API server is not starting. I know this because I can load the client, i.e. I can see the web page, but there are no todos on it and I cannot add one either.

If I run the server manually in my IDE, then the UI also works or seems to work at least (the dotnet run log for example does not change even if I restart it). Here is how my IDE starts the server:

C:\Users\broke\AppData\Local\Programs\Rider\plugins\dpa\DotFiles\JetBrains.DPA.Runner.exe --handle=3100 --backend-pid=27604 --etw-collect-flags=67108622 --detach-event-name=dpa.detach.3100 D:/PharmaPOS/PharmaPOS.Web/src/Server/bin/Debug/net8.0/Server.exe

I've observed that all API calls seem to return HTTP 500.

First, here is the dotnet run log:

PS D:\PharmaPOS\PharmaPOS.Web> dotnet run
run Run
Building project with version: LocalBuild
Shortened DependencyGraph for Target Run:
<== Run
   <== InstallClient
      <== Clean

The running order is:
Group - 1
  - Clean
Group - 2
  - InstallClient
Group - 3
  - Run
Starting target 'Clean'
D:\PharmaPOS\PharmaPOS.Web\src\Client> "dotnet" fable clean --yes (In: false, Out: false, Err: false)
Fable 4.9.0: F# to JavaScript compiler
Minimum fable-library version (when installed from npm): 1.1.1

Thanks to the contributor! @MNie
Stand with Ukraine! https://standwithukraine.com.ua/

This will recursively delete all *.fs.js[.map] files in D:\PharmaPOS\PharmaPOS.Web\src\Client
Deleted output\fable_modules
Clean completed! Files deleted: 0
Finished (Success) 'Clean' in 00:00:00.2775343
Starting target 'InstallClient'
.> "C:\Users\broke\AppData\Local\fnm_multishells\29756_1717198915976\npm.CMD" install (In: false, Out: false, Err: false)

up to date, audited 155 packages in 725ms

21 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
Finished (Success) 'InstallClient' in 00:00:00.9163064
Starting target 'Run'
D:\PharmaPOS\PharmaPOS.Web\src\Shared> "dotnet" build (In: false, Out: false, Err: false)
  Determining projects to restore...
  Paket version 8.0.0+6bcb14ec191f11e984ff0e58016f5987a5cfa8f6
  The last full restore is still up to date. Nothing left to do.
  Total time taken: 0 milliseconds
  Restored D:\PharmaPOS\PharmaPOS.Web\src\Shared\Shared.fsproj (in 127 ms).
  Shared -> D:\PharmaPOS\PharmaPOS.Web\src\Shared\bin\Debug\net8.0\Shared.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.76
server: D:\PharmaPOS\PharmaPOS.Web\src\Server> dotnet watch run
client: D:\PharmaPOS\PharmaPOS.Web\src\Client> dotnet fable watch -o output -s --run npx vite
D:\PharmaPOS\PharmaPOS.Web\src\Server> "dotnet" watch run (In: false, Out: true, Err: true)D:\PharmaPOS\PharmaPOS.Web\src\Client> "dotnet" fable watch -o output -s --run npx vite (In: false, Out: true, Err: true)

client: Fable 4.9.0: F# to JavaScript compiler
client: Minimum fable-library version (when installed from npm): 1.1.1
client: Thanks to the contributor! @ptrelford
client: Stand with Ukraine! https://standwithukraine.com.ua/
client: Parsing Client.fsproj...
client: .> cmd /C dotnet restore Client.csproj -p:FABLE_COMPILER=true -p:FABLE_COMPILER_4=true -p:FABLE_COMPILER_JAVASCRIPT=true
client:   Determining projects to restore...
client:   Paket version 8.0.0+6bcb14ec191f11e984ff0e58016f5987a5cfa8f6
client:   The last full restore is still up to date. Nothing left to do.
client:   Total time taken: 0 milliseconds
server: dotnet watch ?? Started
client:   Paket version 8.0.0+6bcb14ec191f11e984ff0e58016f5987a5cfa8f6
client:   The last full restore is still up to date. Nothing left to do.
client:   Total time taken: 0 milliseconds
client:   Restored D:\PharmaPOS\PharmaPOS.Web\src\Client\Client.csproj (in 178 ms).
client:   1 of 2 projects are up-to-date for restore.
client: Some Nuget packages contain information about NPM dependencies that can be managed by Femto: https://github.com/Zaid-Ajaj/Femto
client: Project and references (63 source files) parsed in 3261ms
server: D:\PharmaPOS\PharmaPOS.Web\.paket\Paket.Restore.targets(171,5): error MSB3073: The command "dotnet paket restore" exited with code -532462766. [D:\PharmaPOS\PharmaPOS.Web\src\Shared\Shared.fsproj]
client: Loaded Feliz.HookAttribute from C:\Users\broke\.nuget\packages\feliz.compilerplugins\2.2.0\lib\netstandard2.0\Feliz.CompilerPlugins.dll
client: Loaded Feliz.ReactComponentAttribute from C:\Users\broke\.nuget\packages\feliz.compilerplugins\2.2.0\lib\netstandard2.0\Feliz.CompilerPlugins.dll
client: Loaded Feliz.ReactMemoComponentAttribute from C:\Users\broke\.nuget\packages\feliz.compilerplugins\2.2.0\lib\netstandard2.0\Feliz.CompilerPlugins.dll
client: Started Fable compilation...
server: D:\PharmaPOS\PharmaPOS.Web\.paket\Paket.Restore.targets(171,5): error MSB3073: The command "dotnet paket restore" exited with code -532462766. [D:\PharmaPOS\PharmaPOS.Web\src\Server\Server.fsproj]
server:
server: The build failed. Fix the build errors and run again.
server: dotnet watch ? Exited with error code 1
server: dotnet watch ? Waiting for a file to change before restarting dotnet...
client: Fable compilation finished in 6059ms
client: .> cmd /C npx vite
client: Watching ..
client:   VITE v5.0.13  ready in 185 ms
client:   ?  Local:   http://localhost:8080/
client:   ?  Network: use --host to expose
client:   ?  press h + enter to show help

Initial browser logs upon opening http://localhost:8080:

prelude.fs:15 Initial state: Model {Todos: RemoteData$1, Input: ''}
prelude.fs:15 Updated subs: FSharpList {head: null, tail: undefined}
prelude.fs:15 New message: Msg {tag: 1, fields: Array(1)}
prelude.fs:15 Updated state: Model {Todos: RemoteData$1, Input: ''}
prelude.fs:15 Updated subs: FSharpList {head: null, tail: undefined}
Http.fs:79 
        
        
       GET http://localhost:8080/api/ITodosApi/getTodos 500 (Internal Server Error)
(anonymous) @ Http.fs:79
(anonymous) @ Async.js:98
(anonymous) @ AsyncBuilder.js:76
onSuccess @ AsyncBuilder.js:89
(anonymous) @ Async.js:83
(anonymous) @ AsyncBuilder.js:76
(anonymous) @ AsyncBuilder.js:86
(anonymous) @ AsyncBuilder.js:76
(anonymous) @ AsyncBuilder.js:113
(anonymous) @ AsyncBuilder.js:76
(anonymous) @ AsyncBuilder.js:86
(anonymous) @ AsyncBuilder.js:76
(anonymous) @ AsyncBuilder.js:113
(anonymous) @ AsyncBuilder.js:76
(anonymous) @ Async.js:88
(anonymous) @ AsyncBuilder.js:76
(anonymous) @ AsyncBuilder.js:86
(anonymous) @ AsyncBuilder.js:76
(anonymous) @ AsyncBuilder.js:113
(anonymous) @ AsyncBuilder.js:76
startWithContinuations @ Async.js:147
start @ Async.js:136
startImmediate @ Async.js:139
(anonymous) @ cmd.fs:123
h @ Event.js:86
(anonymous) @ Event.js:23
Trigger @ Event.js:23
(anonymous) @ Timer.js:37
setTimeout (async)
set Enabled @ Timer.js:31
Timer_delay @ prelude.fs:33
Cmd_OfAsync_start @ cmd.fs:123
(anonymous) @ cmd.fs:139
(anonymous) @ cmd.fs:105
(anonymous) @ cmd.fs:34
(anonymous) @ cmd.fs:26
(anonymous) @ List.js:431
fold @ List.js:363
iterate @ List.js:430
Cmd_exec @ cmd.fs:26
processMsgs @ program.fs:190
ProgramModule_runWithDispatch @ program.fs:198
ProgramModule_runWith @ program.fs:205
(anonymous) @ hmr.fs:162
(anonymous) @ App.fs:20

And the failing initial call (the call to add a todo is similar):

Call stack:

(anonymous) @ http://localhost:8080/output/fable_modules/Fable.Remoting.Client.7.32.0/Http.fs.js:125
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Async.js:98
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:76
onSuccess @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:89
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Async.js:83
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:76
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:86
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:76
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:113
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:76
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:86
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:76
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:113
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:76
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Async.js:88
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:76
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:86
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:76
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:113
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/AsyncBuilder.js:76
startWithContinuations @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Async.js:147
start @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Async.js:136
startImmediate @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Async.js:139
(anonymous) @ http://localhost:8080/output/fable_modules/Fable.Elmish.4.1.0/cmd.fs.js:156
h @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Event.js:86
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Event.js:23
Trigger @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Event.js:23
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Timer.js:37
set Enabled @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/Timer.js:31
Timer_delay @ http://localhost:8080/output/fable_modules/Fable.Elmish.4.1.0/prelude.fs.js:19
Cmd_OfAsync_start @ http://localhost:8080/output/fable_modules/Fable.Elmish.4.1.0/cmd.fs.js:155
(anonymous) @ http://localhost:8080/output/Index.js:71
(anonymous) @ http://localhost:8080/output/fable_modules/Fable.Elmish.4.1.0/cmd.fs.js:130
(anonymous) @ http://localhost:8080/output/fable_modules/Fable.Elmish.4.1.0/cmd.fs.js:32
(anonymous) @ http://localhost:8080/output/fable_modules/Fable.Elmish.4.1.0/cmd.fs.js:12
(anonymous) @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/List.js:431
fold @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/List.js:363
iterate @ http://localhost:8080/output/fable_modules/fable-library.4.9.0/List.js:430
Cmd_exec @ http://localhost:8080/output/fable_modules/Fable.Elmish.4.1.0/cmd.fs.js:10
processMsgs @ http://localhost:8080/output/fable_modules/Fable.Elmish.4.1.0/program.fs.js:249
ProgramModule_runWithDispatch @ http://localhost:8080/output/fable_modules/Fable.Elmish.4.1.0/program.fs.js:263
ProgramModule_runWith @ http://localhost:8080/output/fable_modules/Fable.Elmish.4.1.0/program.fs.js:273
(anonymous) @ http://localhost:8080/output/App.js:126
(anonymous) @ http://localhost:8080/output/App.js:127

And screenshot:

image

Tools:

PS D:\PharmaPOS\PharmaPOS.Web> npm --version
10.8.1
PS D:\PharmaPOS\PharmaPOS.Web> node --version
v20.10.0
PS D:\PharmaPOS\PharmaPOS.Web> dotnet paket --version
Paket version 8.0.0+6bcb14ec191f11e984ff0e58016f5987a5cfa8f6
PS D:\PharmaPOS\PharmaPOS.Web> dotnet fable --version
4.9.0
PS D:\PharmaPOS\PharmaPOS.Web> 

brokenthorn avatar May 31 '24 23:05 brokenthorn