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

Invalid redefinition of constant UserApp #4

Open
tlorans opened this issue Aug 16, 2021 · 5 comments
Open

Invalid redefinition of constant UserApp #4

tlorans opened this issue Aug 16, 2021 · 5 comments

Comments

@tlorans
Copy link

tlorans commented Aug 16, 2021

Hello,
I've got a LoadError: invalid redefinition of constant UserApp.
Do you know how to fix it please?

@jrhadams
Copy link

I've gotten this same error (see below). Out of curiosity, what version of Julia is needed for this demo? My version info can be found here.

Version

julia> versioninfo()
Julia Version 1.6.2
Commit 1b93d53fc4* (2021-07-14 15:36 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)

Stacktrace

julia> Genie.loadapp()
  Activating environment at `~/Sundry_Repos/Stipple-Demo-IrisClustering/Project.toml`
WARNING: replacing module IrisClustering.
ERROR: LoadError: LoadError: invalid redefinition of constant UserApp
Stacktrace:
  [1] top-level scope
    @ none:1
  [2] eval
    @ ./boot.jl:360 [inlined]
  [3] eval
    @ ./Base.jl:39 [inlined]
  [4] main()
    @ Main.IrisClustering ~/Sundry_Repos/Stipple-Demo-IrisClustering/src/IrisClustering.jl:6
  [5] top-level scope
    @ ~/Sundry_Repos/Stipple-Demo-IrisClustering/src/IrisClustering.jl:9
  [6] include
    @ ./client.jl:444 [inlined]
  [7] main()
    @ Main ~/Sundry_Repos/Stipple-Demo-IrisClustering/bootstrap.jl:6
  [8] top-level scope
    @ ~/Sundry_Repos/Stipple-Demo-IrisClustering/bootstrap.jl:5
  [9] include(fname::String)
    @ Base.MainInclude ./client.jl:444
 [10] top-level scope
    @ ~/.julia/packages/Genie/Uvtzb/src/Genie.jl:187
in expression starting at /home/user/Sundry_Repos/Stipple-Demo-IrisClustering/src/IrisClustering.jl:1
in expression starting at /home/user/Sundry_Repos/Stipple-Demo-IrisClustering/bootstrap.jl:5

@tlorans
Copy link
Author

tlorans commented Aug 21, 2021

I've solved the problem: this is due to the fact that the model is set as constant. Then if something went wrong the first time you've load the app, please make sure to retry in a clean workspace (the easier way is to close your current Julia REPL and to open another one).
By the way, the graph will not work as it is defined with a deprecated DataFrames syntax. In the line 46 of the routes.jl file, be sure to replace "for r in eachrow(data[data[cluster_column] .== s, :])" by "for r in eachrow(data[data[:,cluster_column] .==s,:])"

@jrhadams
Copy link

Thanks, @tlorans . For the record, when I've loaded the app from the StippleDemo's repo, I had no issues loading the app. 🤷

@tlorans
Copy link
Author

tlorans commented Aug 21, 2021

Yes this is because in the StippleDemo's repo all the app is within one script, while in the Stipple-Demo-IrisClustering you have a definition of this UserApp as a constant within a file.
To understand all these steps, I encourage you to take a look at the documentation: https://genieframework.github.io/Genie.jl/dev/
In fact, Stipple projects are directly based on the Genie app architecture. And finally with this documentation I've achieved my first web app :).
Be brave, it's worth it!

@jrhadams
Copy link

I appreciate the encouragement. In fact, I've been spending the whole morning looking at Genie for an API backend and went down the stipple rabbit hole. Exciting stuff!

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

No branches or pull requests

2 participants