OxygenFramework / Oxygen.jl

💨 A breath of fresh air for programming web apps in Julia
https://oxygenframework.github.io/Oxygen.jl/
MIT License
383 stars 25 forks source link

Loading error in Oxygen 1.3.0 #136

Closed stamov closed 5 months ago

stamov commented 6 months ago

Hello

As first, big thanks for the amazing library!

upgrading to 1.3.0 gives on my machine the error below. I have both Oxygen and Mustache in my Project.toml, updated to latest versions. Using Julia 1.10-rc3 and Julia 1.10-rc2. Before reporting, cleared everything from the ~/.julia folder to exclude possible interferences with unconsistent Pkg's cache.

v1.2.0 works without problems, Pkg.instantiate() has been executed, Oxygen is not in dev mode.

The error is reported when loading a module with using Mustache, Oxygen in it.

Any chance for a fix or hint how to solve?

With best regards!

┌ Warning: Error requiring `Mustache` from `Oxygen`
│   exception =
│    LoadError: ArgumentError: Package Oxygen does not have Mustache in its dependencies:
│    - You may have a partially installed environment. Try `Pkg.instantiate()`
│      to ensure all packages in the environment are installed.
│    - Or, if you have Oxygen checked out for development and have
│      added Mustache as a dependency but haven't updated your primary
│      environment's manifest file, try `Pkg.resolve()`.
│    - Otherwise you may need to report an issue with Oxygen
│    Stacktrace:
│      [1] macro expansion
│        @ Base ./loading.jl:1770 [inlined]
│      [2] macro expansion
│        @ Base ./lock.jl:267 [inlined]
│      [3] __require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1747
│      [4] #invoke_in_world#3
│        @ Base ./essentials.jl:921 [inlined]
│      [5] invoke_in_world
│        @ Base ./essentials.jl:918 [inlined]
│      [6] require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1740
│      [7] include(mod::Module, _path::String)
│        @ Base ./Base.jl:495
│      [8] include(x::String)
│        @ Oxygen ~/.julia/packages/Oxygen/uzVW4/src/Oxygen.jl:1
│      [9] macro expansion
│        @ ~/.julia/packages/Requires/Z8rfN/src/Requires.jl:40 [inlined]
│     [10] top-level scope
│        @ ~/.julia/packages/Oxygen/uzVW4/src/extensions/load.jl:11
│     [11] eval
│        @ ./boot.jl:385 [inlined]
│     [12] eval
│        @ ~/.julia/packages/Oxygen/uzVW4/src/Oxygen.jl:1 [inlined]
│     [13] (::Oxygen.var"#3#9")()
│        @ Oxygen ~/.julia/packages/Requires/Z8rfN/src/require.jl:101
│     [14] macro expansion
│        @ timing.jl:395 [inlined]
│     [15] err(f::Any, listener::Module, modname::String, file::String, line::Any)
│        @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:47
│     [16] (::Oxygen.var"#2#8")()
│        @ Oxygen ~/.julia/packages/Requires/Z8rfN/src/require.jl:100
│     [17] withpath(f::Any, path::String)
│        @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:37
│     [18] (::Oxygen.var"#1#7")()
│        @ Oxygen ~/.julia/packages/Requires/Z8rfN/src/require.jl:99
│     [19] listenpkg(f::Any, pkg::Base.PkgId)
│        @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:20
│     [20] macro expansion
│        @ Oxygen ~/.julia/packages/Requires/Z8rfN/src/require.jl:98 [inlined]
│     [21] __init__()
│        @ Oxygen ~/.julia/packages/Oxygen/uzVW4/src/extensions/load.jl:10
│     [22] run_module_init(mod::Module, i::Int64)
│        @ Base ./loading.jl:1128
│     [23] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
│        @ Base ./loading.jl:1116
│     [24] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
│        @ Base ./loading.jl:1061
│     [25] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
│        @ Base ./loading.jl:1575
│     [26] _require(pkg::Base.PkgId, env::String)
│        @ Base ./loading.jl:1932
│     [27] __require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base ./loading.jl:1806
│     [28] #invoke_in_world#3
│        @ Base ./essentials.jl:921 [inlined]
│     [29] invoke_in_world
│        @ Base ./essentials.jl:918 [inlined]
│     [30] _require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base ./loading.jl:1797
│     [31] macro expansion
│        @ Base ./loading.jl:1784 [inlined]
│     [32] macro expansion
│        @ Base ./lock.jl:267 [inlined]
│     [33] __require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1747
│     [34] #invoke_in_world#3
│        @ Base ./essentials.jl:921 [inlined]
│     [35] invoke_in_world
│        @ Base ./essentials.jl:918 [inlined]
│     [36] require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1740
│     [37] eval
│        @ ./boot.jl:385 [inlined]
│     [38] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
│        @ Base ./loading.jl:2070
│     [39] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})
│        @ Base ./essentials.jl:887
│     [40] invokelatest(::Any, ::Any, ::Vararg{Any})
│        @ Base ./essentials.jl:884
│     [41] inlineeval(m::Module, code::String, code_line::Int64, code_column::Int64, file::String; softscope::Bool)
│        @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.65.2/scripts/packages/VSCodeServer/src/eval.jl:263
│     [42] (::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
│        @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.65.2/scripts/packages/VSCodeServer/src/eval.jl:181
│     [43] withpath(f::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
│        @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.65.2/scripts/packages/VSCodeServer/src/repl.jl:274
│     [44] (::VSCodeServer.var"#66#71"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
│        @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.65.2/scripts/packages/VSCodeServer/src/eval.jl:179
│     [45] hideprompt(f::VSCodeServer.var"#66#71"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
│        @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.65.2/scripts/packages/VSCodeServer/src/repl.jl:38
│     [46] #65
│        @ ~/.vscode/extensions/julialang.language-julia-1.65.2/scripts/packages/VSCodeServer/src/eval.jl:150 [inlined]
│     [47] (::VSCodeServer.var"#64#69"{VSCodeServer.ReplRunCodeRequestParams})()
│        @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.65.2/scripts/packages/VSCodeServer/src/eval.jl:255
│     [48] #invokelatest#2
│        @ Base ./essentials.jl:887 [inlined]
│     [49] invokelatest(::Any)
│        @ Base ./essentials.jl:884
│     [50] (::VSCodeServer.var"#62#63")()
│        @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.65.2/scripts/packages/VSCodeServer/src/eval.jl:34
│    in expression starting at /Users/ps/.julia/packages/Oxygen/uzVW4/src/extensions/templating/mustache.jl:1
└ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:51
ndortega commented 6 months ago

Hi @stamov,

Thanks for raising this issue and for providing the details, I've been able to reproduce it from my end. As far as a solution, I'm going to play around with how I'm handling the package extension loading and see what works. In the meantime, If you have any ideas yourself feel free to share your thoughts here

stamov commented 5 months ago

For some unrelated reasons (meeetings/other work) totally forgot after I saw the patch to respond on time. So - late, but still - big thanks for the help!