rikhuijzer / PlutoStaticHTML.jl

Convert Pluto notebooks to HTML in automated workflows
https://PlutoStaticHTML.huijzer.xyz
MIT License
83 stars 7 forks source link

`TypeError: in typeassert` error in `_throw_if_error` #169

Closed MichaelHatherly closed 8 months ago

MichaelHatherly commented 1 year ago

It would appear that the :stacktrace coming from Pluto isn't always a CapturedException. For the following notebook I'm getting the below error:

### A Pluto.jl notebook ###
# v0.19.26

using Markdown
using InteractiveUtils

# ╔═╡ fdee78e2-5932-11ee-2841-4b729906916f
'aa'

# ╔═╡ Cell order:
# ╠═fdee78e2-5932-11ee-2841-4b729906916f
julia> using PlutoStaticHTML

julia> PlutoStaticHTML.build_notebooks(BuildOptions("."))
[ Info: Starting evaluation of Pluto notebook "notebook.jl"
[ Info: Finished evaluation of Pluto notebook "notebook.jl" in 2 seconds
ERROR: TypeError: in typeassert, expected CapturedException, got a value of type Vector{Dict{Symbol, Any}}
Stacktrace:
 [1] _throw_if_error(session::Pluto.ServerSession, nb::Pluto.Notebook)
   @ PlutoStaticHTML ~/.julia/packages/PlutoStaticHTML/ax8jf/src/output.jl:179
 [2] _outcome2text(session::Pluto.ServerSession, nb::Pluto.Notebook, in_path::String, bopts::BuildOptions, oopts::OutputOptions)
   @ PlutoStaticHTML ~/.julia/packages/PlutoStaticHTML/ax8jf/src/build.jl:300
 [3] build_notebooks(bopts::BuildOptions, files::Vector{String}, oopts::OutputOptions; session::Pluto.ServerSession)
   @ PlutoStaticHTML ~/.julia/packages/PlutoStaticHTML/ax8jf/src/build.jl:484
 [4] build_notebooks
   @ ~/.julia/packages/PlutoStaticHTML/ax8jf/src/build.jl:468 [inlined]
 [5] build_notebooks
   @ ~/.julia/packages/PlutoStaticHTML/ax8jf/src/build.jl:504 [inlined]
 [6] build_notebooks(bopts::BuildOptions)
   @ PlutoStaticHTML ~/.julia/packages/PlutoStaticHTML/ax8jf/src/build.jl:499
 [7] top-level scope
   @ REPL[2]:1
(build) pkg> st
Status `~/plutostatic-tests/build/Project.toml`
⌅ [c3e4b0f8] Pluto v0.19.26
  [359b1769] PlutoStaticHTML v6.0.14
rikhuijzer commented 1 year ago

Sounds like a very annoying bug!

After this assertion the object goes into showerror which I suspect only works for CapturedException?

I will not have time to fix this in the coming weeks due to PhD deadlines. PRs are welcome and I’ll happily make time to review and get things merged