MommaWatasu / OteraEngine.jl

This package is a template engine for Julia Lang.
https://mommawatasu.github.io/OteraEngine.jl/stable
MIT License
20 stars 4 forks source link

Julia 1.9 can't precompile the package #13

Closed edyu closed 1 year ago

edyu commented 1 year ago
(MyProject) pkg> update OteraEngine
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
    Updating `~/ws/myproject/Project.toml`
  [b2d7f28f] ↑ OteraEngine v0.1.3 ⇒ v0.2.0
    Updating `~/ws/myproject/Manifest.toml`
  [b2d7f28f] ↑ OteraEngine v0.1.3 ⇒ v0.2.0
Precompiling project...
  ✗ MyProject
  1 dependency successfully precompiled in 2 seconds. 21 already precompiled.
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package
  1 dependency had warnings during precompilation:
┌ OteraEngine [b2d7f28f-acd6-4007-8b26-bc27716e5513]
│  WARNING: Method definition showerror(IO, OteraEngine.ParserError) in module OteraEngine at /home/ed/.julia/packages/OteraEngine/lXojN/src/parser.jl:18 overwritten at /home/ed/.julia/packages/OteraEngine/lXojN/src/template.jl:61.
│    ** incremental compilation may be fatally broken for this module **
└
edyu commented 1 year ago

That will cause the following problem when using your template engine:

┌ Error: ERROR:
│   exception =
│    MethodError: no method matching (::OteraEngine.Template)(::Dict{String, String})
│
│    Closest candidates are:
│      (::OteraEngine.Template)(; tmp_init, jl_init)
│       @ OteraEngine ~/.julia/packages/OteraEngine/lXojN/src/template.jl:63
│
│    Stacktrace:

The code was

  tmp = Template("./src/templates/profiles.html")
  init = Dict("name" => current.user.name, "avatar" => current.avatar)
  return html(tmp(init))
edyu commented 1 year ago

Actually has the same problem under 1.8.5 now.

That will cause the following problem when using your template engine:

┌ Error: ERROR: │ exception = │ MethodError: no method matching (::OteraEngine.Template)(::Dict{String, String}) │ │ Closest candidates are: │ (::OteraEngine.Template)(; tmp_init, jl_init) │ @ OteraEngine ~/.julia/packages/OteraEngine/lXojN/src/template.jl:63 │ │ Stacktrace: The code was

tmp = Template("./src/templates/profiles.html") init = Dict("name" => current.user.name, "avatar" => current.avatar) return html(tmp(init))