Include explicit kino requirement on error message (#2260)

This commit is contained in:
José Valim 2023-10-06 21:23:45 +03:00 committed by GitHub
parent 58cc503683
commit f0ca13c88a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -1,7 +1,13 @@
defmodule Livebook.Runtime.Definitions do
@kino_requirement "~> 0.11.0"
def kino_requirement do
@kino_requirement
end
kino = %{
name: "kino",
dependency: %{dep: {:kino, "~> 0.11.0"}, config: []}
dependency: %{dep: {:kino, @kino_requirement}, config: []}
}
kino_vega_lite = %{

View file

@ -410,9 +410,12 @@ defmodule LivebookWeb.Output do
end
defp render_output(output, %{}) do
req = Livebook.Runtime.Definitions.kino_requirement()
render_error_message("""
Unknown output format: #{inspect(output)}. If you're using Kino,
you may want to update Kino and Livebook to the latest version.
Unknown output format: #{inspect(output)}. You may want to explicitly \
add {:kino, "#{req}"} as a notebook dependency or update to the latest \
Livebook.
""")
end