JuliaWeb / WebSockets.jl

A WebSockets library for Julia
MIT License
158 stars 57 forks source link

looks like deps is failing (LoadError: TypeError: in ServerWS, in type definition, expected Type, got a value of type typeof(HTTP.Handlers.RequestHandlerFunction)) #180

Closed AbhimanyuAryan closed 1 year ago

AbhimanyuAryan commented 1 year ago
julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf26 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 7 5800H with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver3)
  Threads: 1 on 16 virtual cores

http: 1.5.3

(@v1.8) pkg> precompile
Precompiling project...
  ✗ WebSockets
  0 dependencies successfully precompiled in 2 seconds. 97 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

WebSockets [104b5d7c-a370-577a-8038-80a2059c5097]

Failed to precompile WebSockets [104b5d7c-a370-577a-8038-80a2059c5097] to C:\Users\aryan\.julia\compiled\v1.8\WebSockets\jl_8B7.tmp.
WARNING: could not import HTTP.handle into WebSockets
WARNING: could not import HTTP.Transaction into WebSockets
ERROR: LoadError: TypeError: in ServerWS, in type definition, expected Type, got a value of type typeof(HTTP.Handlers.RequestHandlerFunction)
Stacktrace:
 [1] top-level scope
   @ C:\Users\aryan\.julia\dev\WebSockets\src\HTTP.jl:289
 [2] include(mod::Module, _path::String)
   @ Base .\Base.jl:419
 [3] include(x::String)
   @ WebSockets C:\Users\aryan\.julia\dev\WebSockets\src\WebSockets.jl:18
 [4] top-level scope
   @ C:\Users\aryan\.julia\dev\WebSockets\src\WebSockets.jl:40
 [5] include
   @ .\Base.jl:419 [inlined]
 [6] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
   @ Base .\loading.jl:1554
 [7] top-level scope
   @ stdin:1
in expression starting at C:\Users\aryan\.julia\dev\WebSockets\src\HTTP.jl:289
in expression starting at C:\Users\aryan\.julia\dev\WebSockets\src\WebSockets.jl:1
in expression starting at stdin:1
mind6 commented 1 year ago

maybe you have HTTP 1 installed? it isn't compatible

AbhimanyuAryan commented 1 year ago

@mind6 it is https://github.com/JuliaWeb/WebSockets.jl/blob/2ea25b7273b052290bbfb30fc205665f137a8a04/Project.toml#L13

hustf commented 1 year ago

WebSockets.jl now has a new version, requiring Julia 1.8.2+ and HTTP 1.1.0 to 1.5. Hopefully, this solves the issue; simply do Pkg.update() and check README.md!