<div dir="ltr"><div><div><div><div><div><div><div>So I am working with the JS FFI, however it seems that the clientOnly directive is being ignored.<br><br></div>Here is the example code:<br><br></div>~~~<br>main.urp:<br>~~~<br><br>ffi js_map<br>jsFunc Js_map.new_map=new_map<br>jsFunc Js_map.new_map_with=new_map_with<br>clientOnly Js_map.new_map<br>clientOnly Js_map.new_map_with<br>benignEffectful Js_map.new_map<br>benignEffectful Js_map.new_map_with<br>jsFile js_map.js<br><br>main<br><br><br>~~~<br></div>main.urs:<br>~~~<br><br>val main : unit -> transaction page<br><br><br>~~~<br></div>main.ur:<br>~~~<br><br>fun main () =<br>    c <- Js_map.new_map_with ((1, 2)::[]);<br>    return <xml></xml><br><br><br>~~~<br></div>js_map.urs:<br>~~~<br><br>con js_map :: Type -> Type -> Type<br><br>val new_map      : k ::: Type -> v ::: Type -> unit -> transaction (js_map k v)<br>val new_map_with : k ::: Type -> v ::: Type -> list (k * v) -> transaction (js_map k v)<br><br><br>~~~<br></div>js_map.js:<br>~~~<br><br>function new_map () {return new Map ();}<br><br>function new_map_with (arg) {return new Map (arg); }<br><br><br>~~~<br></div>So in main.ur, you can see that I am calling this Js code in a C context, instead of getting an error complaining about how it should be called on the client, instead I get this confusing error:<br><br>urweb main<br>/Users/ace/src/cli_only/js_map.urs:4:75: (to 4:87) Unsupported type constructor<br>Constructor:  FFI(Js_map.js_map_with) FFI(Basis.int) FFI(Basis.int)<br>/usr/local/Cellar/urweb/20170105/lib/urweb/ur/basis.urs:127:23: (to 127:25) Unsupported type constructor<br>Constructor:  FFI(Js_map.js_map_with) FFI(Basis.int) FFI(Basis.int)<br>make: *** [all] Error 1<br><br><br></div>