Skip to content

jsaddle missing sync message handler #107

Open
@dmjio

Description

Receiving the following when attempting to use jsaddle w/ miso and ghcid. The webpage never reloads after the buffer is edited. Could be a configuration problem on my part. Posting here in case anyone else knows the fix.

CallStack (from HasCallStack):
  error, called at src/Language/Javascript/JSaddle/WebSockets.hs:129:40 in jsaddle-warp-0.9.6.0-KtjEoVsob1zE4MwtcuErz8:Language.Javascript.JSaddle.WebSockets

Haskell code used.

runApp f =                                                                                            
  Warp.runSettings (Warp.setPort 8080 (Warp.setTimeout 3600 Warp.defaultSettings)) =<<                
    JSaddle.jsaddleOr defaultConnectionOptions (f >> syncPoint) JSaddle.jsaddleApp 

main :: IO ()                                                                                         
main = runApp $ startApp App {..}                                                                     
  where                                                                                               
    initialAction = SayHelloWorld -- initial action to be executed on application load                
    model  = 0                    -- initial model                                                    
    update = updateModel          -- update function                                                  
    view   = viewModel            -- view function                                                    
    events = defaultEvents        -- default delegated events                                         
    subs   = []                   -- empty subscription list                                          
    mountPoint = Nothing          -- mount point for application (Nothing defaults to 'body')         
                     

After calling nix-shell --run reload which invokes ghcid -T ':main'

with (import ./default.nix);                                                                          
dev.env.overrideAttrs (old: {                                                                         
  shellHook = ''                                                                                      
    function reload () {                                                                              
      ${pkgs.haskell.packages.ghc865.ghcid}/bin/ghcid -T ':main'                                       
    }                                                                                                 
  '';                                                                                                 
})                                                                                                    

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions