On app compilation it generates the following error:
== Compilation error in file lib/test_web/views/customers_view.ex ==
** (ArgumentError) invalid value for option :linein quote, got: nil
(elixir 1.10.0) src/elixir_quote.erl:55: :elixir_quote.validate_runtime/2
lib/phoenix_live_view/engine.ex:741: Phoenix.LiveView.Engine.to_safe/3
lib/phoenix_live_view/engine.ex:374: anonymous fn/5 in Phoenix.LiveView.Engine.analyze_static_and_dynamic/5
(elixir 1.10.0) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.0) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
lib/phoenix_live_view/engine.ex:370: Phoenix.LiveView.Engine.analyze_static_and_dynamic/5
lib/phoenix_live_view/engine.ex:341: Phoenix.LiveView.Engine.to_rendered_struct/4
lib/phoenix_live_view/engine.ex:463: Phoenix.LiveView.Engine.maybe_block_to_rendered/3
lib/phoenix_live_view/engine.ex:434: anonymous fn/4 in Phoenix.LiveView.Engine.to_live_struct/3
(elixir 1.10.0) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
lib/phoenix_live_view/engine.ex:433: Phoenix.LiveView.Engine.to_live_struct/3
lib/phoenix_live_view/engine.ex:374: anonymous fn/5 in Phoenix.LiveView.Engine.analyze_static_and_dynamic/5
(elixir 1.10.0) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.0) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
lib/phoenix_live_view/engine.ex:370: Phoenix.LiveView.Engine.analyze_static_and_dynamic/5
lib/phoenix_live_view/engine.ex:341: Phoenix.LiveView.Engine.to_rendered_struct/4
lib/phoenix_live_view/engine.ex:286: Phoenix.LiveView.Engine.handle_body/1
(phoenix 1.4.12) lib/phoenix/template.ex:355: Phoenix.Template.compile/3
(phoenix 1.4.12) lib/phoenix/template.ex:166: anonymous fn/4 in Phoenix.Template."MACRO-__before_compile__"/2
(elixir 1.10.0) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
App Should compile.
defmodule TestWeb.CustomersView do
use TestWeb, :view
def is_active?(tab) do
case tab do
true ->
"is-active"
false ->
""
end
end
end
I'm seeing the same issue on Phoenix LiveView 0.4.1. I don't think it's related to LiveView, it appears to be an EEx issue?
== Compilation error in file lib/qlpex/web/views/layout_view.ex ==
** (ArgumentError) invalid value for option :linein quote, got: nil
(elixir 1.10.0) src/elixir_quote.erl:55: :elixir_quote.validate_runtime/2
lib/phoenix_html/engine.ex:98: Phoenix.HTML.Engine.to_safe/2
lib/phoenix_html/engine.ex:62: Phoenix.HTML.Engine.handle_expr/3
(eex 1.10.0) lib/eex/compiler.ex:46: EEx.Compiler.generate_buffer/4
(phoenix 1.4.11) lib/phoenix/template.ex:354: Phoenix.Template.compile/3
(phoenix 1.4.11) lib/phoenix/template.ex:165: anonymous fn/4 in Phoenix.Template."MACRO-__before_compile__"/2
(elixir 1.10.0) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix 1.4.11) expanding macro: Phoenix.Template.__before_compile__/1
lib/qlpex/web/views/layout_view.ex:1: Qlpex.Web.LayoutView (module)
(elixir 1.10.0) lib/kernel/parallel_compiler.ex:233: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7
This looks related to elixir-lang/elixir#9755
@willfore @brainlid Can you try upgrading :phoenix_html to at least v2.13.4 and see if you app compiles?
This is an issue for Elixir v1.10 and was fixed recently in 1983eed4b0c639e67943c05df5940bf6e44341b9
@mcrumm Yes, updating to :phoenix_html to of v2.13.4 fixed the issue for me. Thanks!
Interestingly I'm already running :phoenix_html 2.13.4 and no change. When I update to master branch of :phoenix_live_view it compiles fine.
Sorry about the confusion, @willfore ! Upgrading phoenix_html was the proper fix for the issue @brainlid encountered.
When I update to master branch it compiles fine.
I'm assuming you mean the master branch of :phoenix_live_view. As @chrismccord said, that _is_ the proper fix for the issue you encountered.
So it looks like upgrading both packages is ultimately what one would want to do on Elixir v1.10.
All good here. Is it safe to assume this will be included in the next release 0.7?
Had the same, after upgrade of both works fine (although bare in mind this one https://github.com/phoenixframework/phoenix_live_view/issues/600#issuecomment-580794024)
I have reverted the verification on Elixir v1.10.1 but it will be added back on Elixir v1.11.0. So meanwhile just update your Elixir version and then update LV once v0.7.0 is out.
Most helpful comment
This looks related to elixir-lang/elixir#9755
@willfore @brainlid Can you try upgrading
:phoenix_htmlto at least v2.13.4 and see if you app compiles?