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

Importing Dash.jl component libraries prior to Dash throws a "UndefVarError: DashBase not defined" error #1432

Closed
rpkyle opened this issue Oct 12, 2020 · 6 comments · Fixed by #1434 or mstoelzle/solving-occlusion#28

Comments

@rpkyle
Copy link
Contributor

rpkyle commented Oct 12, 2020

While generating the Julia version of DashUserGuideComponents, I noticed that the Project.toml doesn't contain an entry for DashBase, e.g.

name = "DashUserGuideComponents"
uuid = "1b08a953-4be3-4667-9a23-e667f8ac7b1d"
authors = ["Chris P <chris@plotly.com>"]
version = "0.0.4"

[deps]
Dash = "1b08a953-4be3-4667-9a23-3db579824955"

[compat]
julia = "1.2"
Dash = "0.1"

Glancing at DashCoreComponents, it looks like the Project.toml includes an entry for DashBase in both the [deps] and [compat] sections.

@waralex @alexcjohnson

@alexcjohnson
Copy link
Collaborator

Yes, that’s expected. The core (dcc, html, table) depend on DashBase so that Dash can depend on them, rather than the other way around as non-core component packages do.

@rpkyle
Copy link
Contributor Author

rpkyle commented Oct 12, 2020

Yes, that’s expected. The core (dcc, html, table) depend on DashBase so that Dash can depend on them, rather than the other way around as non-core component packages do.

OK. I'm guessing that load order is important, then, since I see

julia> using DashUserGuideComponents
[ Info: Precompiling DashUserGuideComponents [1b08a953-4be3-4667-9a23-e667f8ac7b1d]
ERROR: InitError: UndefVarError: DashBase not defined
Stacktrace:
 [1] __init__() at /home/rpkyle/PlotlyRepos/dash-docs/dash-user-guide-components/src/DashUserGuideComponents.jl:12
 [2] run_repl(::REPL.AbstractREPL, ::Any) at /build/julia/src/julia-1.5.2/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:288
during initialization of module DashUserGuideComponents

julia> using Dash

julia> using DashUserGuideComponents

If that's true, we'll just have to be careful to note this in the documentation since it may cause some confusion otherwise. Closing.

@rpkyle rpkyle closed this as completed Oct 12, 2020
@alexcjohnson
Copy link
Collaborator

Hmm, so dugc is trying to import DashBase? It shouldn’t, it should get the base component class from Dash instead.

@alexcjohnson alexcjohnson reopened this Oct 12, 2020
@rpkyle rpkyle changed the title Dash.jl package generated without DashBase included in Project.toml Importing Dash.jl component libraries prior to Dash throws a "UndefVarError: DashBase not defined" error Oct 12, 2020
@alexcjohnson
Copy link
Collaborator

@waralex if I'm understanding this correctly we just need to have DashBase in these lines:

DashBase.register_package(
DashBase.ResourcePkg(

jl_resource_tuple_string = """DashBase.Resource(

swap to Dash based on whether we're building a core or non-core package, right?

def base_package_name(project_shortname):
return "DashBase" if is_core_package(project_shortname) else "Dash"

@waralex
Copy link
Contributor

waralex commented Oct 12, 2020

This is pretty weird, I'm trying to figure out what the problem is

@rpkyle
Copy link
Contributor Author

rpkyle commented Oct 12, 2020

@alexcjohnson I think we can close this one once Dash.jl is updated via the Registrator, at least on my end the error no longer appears in v0.1.3.

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