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

Using @init in module scope causes error with Genie.loadapp() #212

Open
PGimenez opened this issue Jul 18, 2023 · 0 comments
Open

Using @init in module scope causes error with Genie.loadapp() #212

PGimenez opened this issue Jul 18, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@PGimenez
Copy link
Member

I have an app where I want to sync the UI across multiple users, so I'm using the @initmacro. When launching the app with

using GenieFramework; Genie.loadapp(); up()

I'm getting this error:

Active env: DEV

Loading appERROR: [ Info: 2023-07-18 23:06:58 Watching ["/Users/pere/genie/mwes"]
MethodError: no method matching __GF_AUTO_HANDLERS__(::Main.App.var"##Main.App_ReactiveModel!#375")
Stacktrace:
 [1] invokelatest(f::typeof(Main.App.__GF_AUTO_HANDLERS__), args::Tuple{Main.App.var"##Main.App_ReactiveModel!#375"}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Base essentials.jl:816
 [2] invokelatest(f::typeof(Main.App.__GF_AUTO_HANDLERS__), args::Tuple{Main.App.var"##Main.App_ReactiveModel!#375"})
   @ Base essentials.jl:813
 [3] top-level scope
   @ ~/.julia/packages/Stipple/a9IBQ/src/ReactiveTools.jl:541
in expression starting at /Users/pere/.julia/packages/Stipple/a9IBQ/src/ReactiveTools.jl:541

Still, the app works fine despite this error. Starting the app with include does not yield an error. This is the code:

module App
using GenieFramework
@genietools

@app begin
    @out toggle_list = ["red", "green", "yellow"]
    @in indiv = false
    @in toggle_states = []
end

model = @init

@page("/", "toggles.jl.html")
@page("/shared", "toggles.jl.html", Stipple.ReactiveTools.DEFAULT_LAYOUT(), model)

end
<div v-for="toggle in toggle_list">
    <q-toggle v-model="toggle_states" :label="toggle" :val="toggle" />
</div>
<q-toggle v-model="indiv" />
{{toggle_states}}
{{indiv}}
@essenciary essenciary self-assigned this Sep 5, 2023
@essenciary essenciary added the bug Something isn't working label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants