philss / floki

Floki is a simple HTML parser that enables search for nodes using CSS selectors.
https://hex.pm/packages/floki
MIT License
2.05k stars 155 forks source link

HtmlEntities module not found for encode/1 when running production #163

Closed kevinwo closed 6 years ago

kevinwo commented 6 years ago

When defp raw_html([string | tail], html) when is_binary(string) attempts to use HtmlEntities.encode/1, it cannot be found:

(exit) an exception was raised: (UndefinedFunctionError) function HtmlEntities.encode/1 is undefined (module HtmlEntities is not available) HtmlEntities.encode("Text") (floki) lib/floki.ex:114: Floki.raw_html/2 (floki) lib/floki.ex:157: Floki.tag_for/3 (floki) lib/floki.ex:136: Floki.raw_html/2 (floki) lib/floki.ex:157: Floki.tag_for/3 (floki) lib/floki.ex:136: Floki.raw_html/2 (floki) lib/floki.ex:158: Floki.tag_for/3 (floki) lib/floki.ex:136: Floki.raw_html/2

Things run just fine locally on dev, but seem to run into the above issue on production deployment.

philss commented 6 years ago

Hi @kevinwo! The PR #165 should fix the problem. I will release a new version very soon. Thanks!

philss commented 6 years ago

@kevinwo please try again with version 0.19.3. It should work now.