fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.94k stars 285 forks source link

Failed to load notebook https://featured.plutojl.org/basic/Basic%20mathematics.jl #2621

Open jchidley opened 1 year ago

jchidley commented 1 year ago

Thank you for reporting an issue about Pluto! Let's get it fixed!

Failed to load notebook

The notebook from https://featured.plutojl.org/basic/Basic%20mathematics.jl could not be loaded. Please [report this error](https://github.com/fonsp/Pluto.jl/issues)!

[Go back](http://localhost:1234/open?url=https%3A%2F%2Ffeatured.plutojl.org%2Fbasic%2FBasic%2520mathematics.jl#)

Error message:

BoundsError: attempt to access empty SubString{String} at index [0]
Stacktrace:
  [1] checkbounds
    @ ./strings/basic.jl:216 [inlined]
  [2] getindex(s::SubString{String}, i::Int64)
    @ Base ./strings/substring.jl:91
  [3] getindex(source::SourceFile, i::Int64)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/irSvg/src/source_files.jl:120
  [4] highlight(io::Base.TTY, source::SourceFile, range::UnitRange{Int64}; color::Tuple{Int64, Int64, Int64}, context_lines_before::Int64, context_lines_inner::Int64, context_lines_after::Int64, note::String, notecolor::Symbol)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/irSvg/src/source_files.jl:222
  [5] highlight
    @ ~/.julia/packages/JuliaSyntax/irSvg/src/source_files.jl:190 [inlined]
  [6] show_diagnostic(io::Base.TTY, diagnostic::JuliaSyntax.Diagnostic, source::SourceFile)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/irSvg/src/diagnostics.jl:76
  [7] show_diagnostics(io::Base.TTY, diagnostics::Vector{JuliaSyntax.Diagnostic}, source::SourceFile)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/irSvg/src/diagnostics.jl:86
  [8] showerror
    @ ~/.julia/packages/JuliaSyntax/irSvg/src/parser_api.jl:20 [inlined]
  [9] showerror(io::Base.TTY, ex::JuliaSyntax.ParseError, bt::Vector{Base.StackTraces.StackFrame}; backtrace::Bool)
    @ Base ./errorshow.jl:88
 [10] showerror(io::Base.TTY, ex::JuliaSyntax.ParseError, bt::Vector{Base.StackTraces.StackFrame})
    @ Base ./errorshow.jl:86
 [11] try_compute_symbolreferences(ex::Expr)
    @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:1233
 [12] |>
    @ ./operators.jl:907 [inlined]
 [13] updated_topology(old_topology::Pluto.NotebookTopology, notebook::Pluto.Notebook, cells::Vector{Pluto.Cell})
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/analysis/TopologyUpdate.jl:14
 [14] load_notebook(path::String; disable_writing_notebook_files::Bool)
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/notebook/saving and loading.jl:342
 [15] load_notebook
    @ ~/.julia/packages/Pluto/kxeso/src/notebook/saving and loading.jl:330 [inlined]
 [16] open(session::Pluto.ServerSession, path::String; run_async::Bool, compiler_options::Nothing, as_sample::Bool, clear_frontmatter::Bool, notebook_id::Base.UUID)
    @ Pluto.SessionActions ~/.julia/packages/Pluto/kxeso/src/webserver/SessionActions.jl:66
 [17] open_url(session::Pluto.ServerSession, url::String; kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:as_sample,), Tuple{Bool}}})
    @ Pluto.SessionActions ~/.julia/packages/Pluto/kxeso/src/webserver/SessionActions.jl:0
 [18] open_url
    @ ~/.julia/packages/Pluto/kxeso/src/webserver/SessionActions.jl:22 [inlined]
 [19] (::Pluto.var"#try_launch_notebook_response#355"{Pluto.var"#try_launch_notebook_response#349#356"{Pluto.ServerSession}})(action::typeof(Pluto.SessionActions.open_url), path_or_url::String; title::String, advice::String, home_url::String, as_redirect::Bool, action_kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:as_sample,), Tuple{Bool}}})
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/webserver/Router.jl:18
 [20] (::Pluto.var"#serve_openfile#358"{Pluto.ServerSession})(request::HTTP.Messages.Request)
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/webserver/Router.jl:57
 [21] (::HTTP.Handlers.Router{typeof(Pluto.default_404), typeof(HTTP.Handlers.default405), Nothing})(req::HTTP.Messages.Request)
    @ HTTP.Handlers ~/.julia/packages/HTTP/nn2yB/src/Handlers.jl:439
 [22] (::Pluto.var"#342#344"{HTTP.Handlers.Router{typeof(Pluto.default_404), typeof(HTTP.Handlers.default405), Nothing}})(request::HTTP.Messages.Request)
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/webserver/Authentication.jl:101
 [23] #339
    @ ~/.julia/packages/Pluto/kxeso/src/webserver/Authentication.jl:53 [inlined]
 [24] (::Pluto.var"#442#452"{Pluto.ServerSession, Pluto.var"#339#341"{Pluto.var"#342#344"{HTTP.Handlers.Router{typeof(Pluto.default_404), typeof(HTTP.Handlers.default405), Nothing}}, Pluto.ServerSession}})(http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.Connections.Connection{Sockets.TCPSocket}})
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/webserver/WebServer.jl:251
 [25] #invokelatest#2
    @ ./essentials.jl:816 [inlined]
 [26] invokelatest
    @ ./essentials.jl:813 [inlined]
 [27] handle_connection(f::Function, c::HTTP.Connections.Connection{Sockets.TCPSocket}, listener::HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, readtimeout::Int64, access_log::Nothing)
    @ HTTP.Servers ~/.julia/packages/HTTP/nn2yB/src/Servers.jl:447
 [28] macro expansion
    @ ~/.julia/packages/HTTP/nn2yB/src/Servers.jl:385 [inlined]
 [29] (::HTTP.Servers.var"#16#17"{Pluto.var"#442#452"{Pluto.ServerSession, Pluto.var"#339#341"{Pluto.var"#342#344"{HTTP.Handlers.Router{typeof(Pluto.default_404), typeof(HTTP.Handlers.default405), Nothing}}, Pluto.ServerSession}}, HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, Set{HTTP.Connections.Connection}, Int64, Nothing, Base.Semaphore, HTTP.Connections.Connection{Sockets.TCPSocket}})()
    @ HTTP.Servers ./task.jl:514
jchidley commented 1 year ago

This comment -


"But my issue is really simple, I don't want to make a screen recording / notebook!

Please do it anyways! It is really difficult to know exactly what information we will need to solve the issue, and a video recording can save a lot of follow-up questions."


nearly stopped me reporting the bug. Is that what you want?

Bear in mind that I had to click on your link, login to Github and fill out your form, just to get to this comment. That was after something broke, which is frustrating, so I could easily have just ignored the thing.

pankgeorg commented 1 year ago

This comment -


"But my issue is really simple, I don't want to make a screen recording / notebook!

Please do it anyways! It is really difficult to know exactly what information we will need to solve the issue, and a video recording can save a lot of follow-up questions."


nearly stopped me reporting the bug. Is that what you want?

Yes. We need your help in triaging bugs

Bear in mind that I had to click on your link, login to Github and fill out your form, just to get to this comment. That was after something broke, which is frustrating, so I could easily have just ignored the thing.

I'm sorry if this caused you too much trouble.

Please note that the Pluto community tries to abide by julialang's community standards: https://julialang.org/community/standards/

jchidley commented 1 year ago

Just rechecked this on my Windows Surface Laptop 3 (AMD chipset). Works fine on the latest released build (v0.19.27).

The original problem occured on my Macbook Air M1 (ARM chipset). Same Pluto version. Still doesn't work.

jchidley commented 1 year ago

This appears on my Mac/Julia console:

julia> Pluto.run()
[ Info: Loading...
┌ Info: 
â”” Opening http://localhost:1234/?secret=DhZmeIC6 in your default browser... ~ have fun!
┌ Info: 
│ Press Ctrl+C in this terminal to stop Pluto
â”” 
┌ Error: Expression explorer failed on: 
│   ex =
│    :($(Expr(:toplevel, :(#= /Users/jchidley/.julia/pluto_notebooks/sample Basic mathematics 1.jl#==#edb95b14-d473-11ea-3a5a-77382d31f941:1 =#), :(md"## Finding the best pizza deal
│    
│    Let's see if a larger pizza is a better value by calculating the price per area.  There are 4 sizes: small, medium, large, extra large with the following prices:
│    
│    Size     | Diameter (inches) | Price ($)
│    :------- | :---------------: | --------:
│    small    | 9  | 13.10
│    medium   | 13 | 20.95
│    large    | 15 | 24.90 
│    XL       | 17 | 30.95
│    
│    ### 1. How many small pizzas is the same as one XL pizza?
│    
│    Edit the expression below:
│    "))))
â”” @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:1232
ParseError:
# Error @ none:1:1

Stacktrace:
  [1] #parse#3
    @ ./meta.jl:236 [inlined]
  [2] parse
    @ ./meta.jl:232 [inlined]
  [3] _parse(stream::Base.GenericIOBuffer{SubArray{UInt8, 1, Vector{UInt8}, Tuple{UnitRange{Int64}}, true}}; greedy::Bool, raise::Bool)
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/Julia/interp.jl:5
  [4] _parse
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/Julia/interp.jl:3 [inlined]
  [5] interpinner(stream::Base.GenericIOBuffer{SubArray{UInt8, 1, Vector{UInt8}, Tuple{UnitRange{Int64}}, true}}, greedy::Bool)
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/Julia/interp.jl:14
  [6] interpinner
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/Julia/interp.jl:11 [inlined]
  [7] #91
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/Julia/interp.jl:27 [inlined]
  [8] withstream
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/parse/util.jl:113 [inlined]
  [9] interp(stream::Base.GenericIOBuffer{SubArray{UInt8, 1, Vector{UInt8}, Tuple{UnitRange{Int64}}, true}}, md::Markdown.MD)
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/Julia/interp.jl:26
 [10] parseinline(stream::Base.GenericIOBuffer{SubArray{UInt8, 1, Vector{UInt8}, Tuple{UnitRange{Int64}}, true}}, md::Markdown.MD, parsers::Vector{Function})
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/parse/parse.jl:47
 [11] parseinline(stream::Base.GenericIOBuffer{SubArray{UInt8, 1, Vector{UInt8}, Tuple{UnitRange{Int64}}, true}}, md::Markdown.MD, config::Markdown.Config)
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/parse/parse.jl:57
 [12] parseinline
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/parse/parse.jl:72 [inlined]
 [13] parseinline
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/parse/parse.jl:75 [inlined]
 [14] #56
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/GitHub/table.jl:54 [inlined]
 [15] iterate
    @ ./generator.jl:47 [inlined]
 [16] collect_to!(dest::Vector{Vector{Any}}, itr::Base.Generator{Vector{SubString{String}}, Markdown.var"#56#58"{Markdown.MD}}, offs::Int64, st::Int64)
    @ Base ./array.jl:840
 [17] collect_to_with_first!
    @ ./array.jl:818 [inlined]
 [18] _collect(c::Vector{SubString{String}}, itr::Base.Generator{Vector{SubString{String}}, Markdown.var"#56#58"{Markdown.MD}}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:812
 [19] collect_similar
    @ ./array.jl:711 [inlined]
 [20] map
    @ ./abstractarray.jl:3261 [inlined]
 [21] (::Markdown.var"#55#57"{IOBuffer, Markdown.MD})()
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/GitHub/table.jl:54
 [22] withstream
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/parse/util.jl:113 [inlined]
 [23] github_table(stream::IOBuffer, md::Markdown.MD)
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/GitHub/table.jl:41
 [24] parse(stream::IOBuffer, block::Markdown.MD, config::Markdown.Config; breaking::Bool)
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/parse/parse.jl:83
 [25] parse
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/parse/parse.jl:79 [inlined]
 [26] parse(stream::IOBuffer; flavor::Symbol)
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/parse/parse.jl:94
 [27] parse
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/parse/parse.jl:91 [inlined]
 [28] #parse#175
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/Markdown.jl:31 [inlined]
 [29] parse
    @ ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/Markdown.jl:31 [inlined]
 [30] mdexpr(s::String, flavor::Symbol)
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/Markdown.jl:35
--- the last 1 lines are repeated 1 more time ---
 [32] var"@md_str"(__source__::LineNumberNode, __module__::Module, s::Any, t::Vararg{Any})
    @ Markdown ~/.julia/juliaup/julia-1.9.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Markdown/src/Markdown.jl:44
 [33] #macroexpand#63
    @ ./expr.jl:121 [inlined]
 [34] macroexpand
    @ ./expr.jl:117 [inlined]
 [35] maybe_macroexpand(ex::Expr; recursive::Bool, expand_bind::Bool)
    @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:1042
 [36] maybe_macroexpand
    @ ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:1036 [inlined]
 [37] explore_macrocall!(ex::Expr, scopestate::Pluto.ExpressionExplorer.ScopeState)
    @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:473
 [38] explore!(ex::Expr, scopestate::Pluto.ExpressionExplorer.ScopeState)
    @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:795
 [39] (::Pluto.ExpressionExplorer.var"#41#42"{Pluto.ExpressionExplorer.ScopeState})(a::Expr)
    @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:775
 [40] umapfoldl(f::Function, itr::Vector{Any}; init::Pluto.ExpressionExplorer.SymbolsState)
    @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:417
 [41] umapfoldl(f::Function, itr::Vector{Any})
    @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:411
 [42] explore_fallback!
    @ ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:775 [inlined]
 [43] explore!(ex::Expr, scopestate::Pluto.ExpressionExplorer.ScopeState)
    @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:832
 [44] compute_symbolreferences
    @ ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:1220 [inlined]
 [45] try_compute_symbolreferences(ex::Expr)
    @ Pluto.ExpressionExplorer ~/.julia/packages/Pluto/kxeso/src/analysis/ExpressionExplorer.jl:1227
 [46] |>
    @ ./operators.jl:907 [inlined]
 [47] updated_topology(old_topology::Pluto.NotebookTopology, notebook::Pluto.Notebook, cells::Vector{Pluto.Cell})
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/analysis/TopologyUpdate.jl:14
 [48] load_notebook(path::String; disable_writing_notebook_files::Bool)
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/notebook/saving and loading.jl:342
 [49] load_notebook
    @ ~/.julia/packages/Pluto/kxeso/src/notebook/saving and loading.jl:330 [inlined]
 [50] open(session::Pluto.ServerSession, path::String; run_async::Bool, compiler_options::Nothing, as_sample::Bool, clear_frontmatter::Bool, notebook_id::Base.UUID)
    @ Pluto.SessionActions ~/.julia/packages/Pluto/kxeso/src/webserver/SessionActions.jl:66
 [51] open
    @ ~/.julia/packages/Pluto/kxeso/src/webserver/SessionActions.jl:44 [inlined]
 [52] (::Pluto.var"#try_launch_notebook_response#355"{Pluto.var"#try_launch_notebook_response#349#356"{Pluto.ServerSession}})(action::typeof(Pluto.SessionActions.open), path_or_url::String; title::String, advice::Stri
ng, home_url::String, as_redirect::Bool, action_kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:as_sample, :clear_frontmatter), Tuple{Bool, Bool}}})
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/webserver/Router.jl:18
 [53] (::Pluto.var"#serve_notebookupload#368")(request::HTTP.Messages.Request)
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/webserver/Router.jl:190
 [54] (::HTTP.Handlers.Router{typeof(Pluto.default_404), typeof(HTTP.Handlers.default405), Nothing})(req::HTTP.Messages.Request)
    @ HTTP.Handlers ~/.julia/packages/HTTP/nn2yB/src/Handlers.jl:439
 [55] (::Pluto.var"#342#344"{HTTP.Handlers.Router{typeof(Pluto.default_404), typeof(HTTP.Handlers.default405), Nothing}})(request::HTTP.Messages.Request)
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/webserver/Authentication.jl:101
 [56] #339
    @ ~/.julia/packages/Pluto/kxeso/src/webserver/Authentication.jl:53 [inlined]
 [57] (::Pluto.var"#442#452"{Pluto.ServerSession, Pluto.var"#339#341"{Pluto.var"#342#344"{HTTP.Handlers.Router{typeof(Pluto.default_404), typeof(HTTP.Handlers.default405), Nothing}}, Pluto.ServerSession}})(http::HTTP.
Streams.Stream{HTTP.Messages.Request, HTTP.Connections.Connection{Sockets.TCPSocket}})
    @ Pluto ~/.julia/packages/Pluto/kxeso/src/webserver/WebServer.jl:251
 [58] #invokelatest#2
    @ ./essentials.jl:816 [inlined]
 [59] invokelatest
    @ ./essentials.jl:813 [inlined]
 [60] handle_connection(f::Function, c::HTTP.Connections.Connection{Sockets.TCPSocket}, listener::HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, readtimeout::Int64, access_log::Nothing)
    @ HTTP.Servers ~/.julia/packages/HTTP/nn2yB/src/Servers.jl:447
 [61] macro expansion
    @ ~/.julia/packages/HTTP/nn2yB/src/Servers.jl:385 [inlined]