Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility between revise and middleware arguments in serve? #231

Closed
fypc opened this issue Nov 3, 2024 · 2 comments · Fixed by #232
Closed

Incompatibility between revise and middleware arguments in serve? #231

fypc opened this issue Nov 3, 2024 · 2 comments · Fixed by #232

Comments

@fypc
Copy link

fypc commented Nov 3, 2024

Using revise with middleware arguments in the serve function generates the following error:

ERROR: LoadError: MethodError: Cannot `convert` an object of type Oxygen.Core.ReviseHandler to an object of type typeof(CorsMiddleware)
The function `convert` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  convert(::Type{T}, ::T) where T
   @ Base Base.jl:126

Stacktrace:
 [1] insert!(a::Vector{typeof(CorsMiddleware)}, i::Int64, item::Oxygen.Core.ReviseHandler)
   @ Base ./array.jl:1733
 [2] serve(ctx::Oxygen.Core.AppContext.Context; middleware::Vector{typeof(CorsMiddleware)}, handler::typeof(Oxygen.Core.stream_handler), host::String, port::Int64, async::Bool, parallel::Bool, serialize::Bool, catch_errors::Bool, docs::Bool, metrics::Bool, show_errors::Bool, show_banner::Bool, docs_path::String, schema_path::String, external_url::Nothing, revise::Symbol, kwargs::@Kwargs{})
   @ Oxygen.Core ~/.julia/packages/Oxygen/ObBBn/src/core.jl:135
 [3] serve
   @ ~/.julia/packages/Oxygen/ObBBn/src/core.jl:90 [inlined]
 [4] serve(; kwargs::@Kwargs{host::String, port::Int64, middleware::Vector{typeof(CorsMiddleware)}, revise::Symbol})
   @ OxygenTutorial ~/.julia/packages/Oxygen/ObBBn/src/methods.jl:19
 [5] serve
   @ ~/.julia/packages/Oxygen/ObBBn/src/methods.jl:15 [inlined]
 [6] up()
   @ OxygenTutorial ~/Documents/GitHub/Oxygen_Tutorial/src/OxygenTutorial.jl:100
@ndortega
Copy link
Member

ndortega commented Nov 4, 2024

@frankier any initial thoughts?

@frankier
Copy link
Contributor

frankier commented Nov 4, 2024

Probably quite an obvious/simple error. I'll make a PR this week. At least this gives some kind of guidance to what kind of testing is needed >_<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants