SAFE-Stack / SAFE-template

dotnet CLI template for SAFE project
MIT License
283 stars 88 forks source link

Updating the SAFE min V2 template to the latest Saturn preview breaks Fable Remoting #371

Closed teknikal-wizard closed 4 years ago

teknikal-wizard commented 4 years ago

I tried to update a SAFE project to the latest Saturn 0.15.0-preview01 release, because it contains some important app builder updates.

This version of Saturn requires Giraffe 5.0.0-alpha-002.

When running the app after updating, the website will deploy but the UI is not connected, and I get this stack trace in the terminal:

fail: Giraffe.Middleware.GiraffeErrorHandlerMiddleware[0]
An unhandled exception has occurred while executing the request.
System.IO.FileLoadException: Could not load file or assembly 'Giraffe, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'Giraffe, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null'
   at Fable.Remoting.Giraffe.GiraffeUtil.buildFromImplementation$cont@101[a,b](a impl, RemotingOptions`2 options, FSharpMap`2 dynamicFunctions, FSharpFunc`2 next, HttpContext ctx, FSharpOption`1 foundFunction, Unit unitVar)
   at Fable.Remoting.Giraffe.GiraffeUtil.buildFromImplementation@81-1.Invoke(Unit unitVar)
   at FSharp.Control.Tasks.TaskBuilder.run[a](FSharpFunc`2 firstStep)
--- End of stack trace from previous location where exception was thrown ---
   at FSharp.Control.Tasks.TaskBuilder.bindTaskConfigureFalse[a,b](Task`1 task, FSharpFunc`2 continuation)
   at FSharp.Control.Tasks.TaskBuilder.run[a](FSharpFunc`2 firstStep)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
   at Giraffe.Middleware.Invoke@63-5.Invoke(Unit unitVar)
   at FSharp.Control.Tasks.TaskBuilder.tryWith[a](FSharpFunc`2 step, FSharpFunc`2 catch)

I have created a repro here: https://github.com/Ryan-Palmer-CIT/Safe-Saturn-Update-Bug-Repro

@Zaid-Ajaj and @dustinmoris , it was suggested I tag you guys here :)

isaacabraham commented 4 years ago

Also tagging @theimowski

Zaid-Ajaj commented 4 years ago

Looks like a compatibility issue. I think I need to better restrict the upper bound on the version of the Giraffe dependency

2020_06_29_14_14_47_Safe_Saturn_Update_Bug_Repro_paket lock_at_master_Ryan_Palmer_CIT_Safe_Saturn_