You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Surface.Formatter.Plugin incompatible with Elixir 1.19.0-rc.0 - Enumerable protocol error for keyword lists #766
The Surface formatter plugin (v0.12.1) is incompatible with Elixir 1.19.0-rc.0. When running mix format on .sface files, the formatter fails with a protocol error, incorrectly treating keyword list expressions in attributes as BitStrings.
Create a .sface file with a slot that uses :let with keyword list syntax:
<:company_name_label :let={for: for_id}>
Run mix format
Root cause
The Surface formatter at lib/surface/formatter/phases/render.ex:451 (in format_attribute_expression/2) appears to be receiving keyword list expressions as strings (BitStrings) instead of proper AST structures when running under Elixir 1.19.0-rc.0.
Fix
PR #767 fixes this by using IO.iodata_to_binary and String.slice instead of Enum.slice.
Workaround
Temporarily disable the Surface.Formatter.Plugin in .formatter.exs:
plugins: [# Surface.Formatter.Plugin, # Temporarily disabled due to Elixir 1.19.0-rc.0 incompatibilityPhoenix.LiveView.HTMLFormatter,# ... other plugins]
Activity