talonframework / talon_blog_demo

A Phoenix 1.3 structured Talon Demo
8 stars 6 forks source link

Error on Windows #5

Open tmbb opened 7 years ago

tmbb commented 7 years ago

I get this error, caused by Slime complaining of line feed characters on windows:

== Compilation error on file lib/talon_blog_demo/talon/views/admin/admin-lte/layout_view.ex ==
** (Slime.TemplateSyntaxError) got FunctionClauseError with message "no function clause matching in String.duplicate/2" while retrieving Exception.message/1 for %Slime.TemplateSyntaxError{column: 0, line: "  head\r", line_number: 3, message: "{:no_match, <<14>>}", source: "INPUT"}
    (slime) lib/slime/parser.ex:27: Slime.Parser.handle_syntax_error/3
    (slime) lib/slime/renderer.ex:17: Slime.Renderer.precompile/1
    (phoenix_slime) lib/phoenix_slime/engine.ex:9: PhoenixSlime.Engine.compile/2
    (phoenix) lib/phoenix/template.ex:378: Phoenix.Template.compile/2
    (phoenix) lib/phoenix/template.ex:186: Phoenix.Template."-MACRO-__before_compile__/2-fun-0-"/3
    (elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
    (phoenix) expanding macro: Phoenix.Template.__before_compile__/1
    lib/talon_blog_demo/talon/views/admin/admin-lte/layout_view.ex:1: TalonBlogDemo.Admin.AdminLte.Web.LayoutView (module)
    (elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1

I've submitted a pull request to Slime that fixes this. Until it's merged and released, we should keep this issue.

Maybe add this issue to talon, since any project using slime templates will be affected?

tmbb commented 7 years ago

It turns out that the issue can't be easily attributed to Slime, even though my PR actually fixes the problem... It's strange.