SimonDanisch / Bonito.jl

Serving JS to the browser
MIT License
204 stars 28 forks source link

Error with JSS.export_standalone() #108

Open AlexisRenchon opened 2 years ago

AlexisRenchon commented 2 years ago

e.g.,

using JSServe, WGLMakie

function handler(session, request)
    return scatter(1:4, color=1:4)
end

dir = joinpath(@__DIR__, "test")
mkdir(dir)
JSServe.export_standalone(handler, dir)

gives the error

ERROR: MethodError: no method matching JSServe.UrlSerializer(::Bool, ::String, ::Bool, ::String
)
Closest candidates are:
  JSServe.UrlSerializer(::Bool, ::Union{Nothing, String}, ::Bool, ::String, ::Bool) at /home/al
exis/.julia/packages/JSServe/E7QrV/src/types.jl:114
  JSServe.UrlSerializer(::Any, ::Any, ::Any, ::Any, ::Any) at /home/alexis/.julia/packages/JSSe
rve/E7QrV/src/types.jl:114
Stacktrace:
 [1] export_standalone(dom_handler::Function, folder::String; clear_folder::Bool, write_index_h
tml::Bool, absolute_urls::Bool, content_delivery_url::String)
   @ JSServe ~/.julia/packages/JSServe/E7QrV/src/offline.jl:128
 [2] export_standalone(dom_handler::Function, folder::String)
   @ JSServe ~/.julia/packages/JSServe/E7QrV/src/offline.jl:123
 [3] top-level scope
   @ REPL[35]:1
HaoxuanGuo commented 2 years ago

The same problem occurred. Any progress?

SimonDanisch commented 2 years ago

https://github.com/SimonDanisch/JSServe.jl/pull/113

AlexisRenchon commented 2 years ago

One thing that worked for me is create a figure locally, and then copy the html, instead of using export_standalone