pragdave / earmark

Markdown parser for Elixir
Other
859 stars 135 forks source link

v1.4.41 regression: module :string_lexer is not available #468

Closed tercenya closed 11 months ago

tercenya commented 11 months ago

With v1.4.41, I get

** (exit) an exception was raised:
    ** (UndefinedFunctionError) function :string_lexer.string/1 is undefined (module :string_lexer is not available)
        :string_lexer.string(~c"this is an example string")
        (earmark 1.4.41) lib/earmark_parser/helpers/leex_helpers.ex:20: EarmarkParser.Helpers.LeexHelpers.tokenize/2
        (earmark 1.4.41) lib/earmark_parser/helpers/lookahead_helpers.ex:17: EarmarkParser.Helpers.LookaheadHelpers.opens_inline_code/1
        (earmark 1.4.41) lib/earmark_parser/parser.ex:658: EarmarkParser.Parser._inline_or_text?/2
        (earmark 1.4.41) lib/earmark_parser/parser.ex:486: EarmarkParser.Parser._consolidate_para/4
        (earmark 1.4.41) lib/earmark_parser/parser.ex:215: EarmarkParser.Parser._parse/4
        (earmark 1.4.41) lib/earmark_parser/parser.ex:68: EarmarkParser.Parser.lines_to_blocks/3
        (earmark 1.4.41) lib/earmark_parser/parser.ex:60: EarmarkParser.Parser.parse_lines/3
        (earmark 1.4.41) lib/earmark_parser/parser.ex:26: EarmarkParser.Parser.parse_markdown/2
        (earmark 1.4.41) lib/earmark_parser.ex:621: EarmarkParser._as_ast/2
        (earmark 1.4.41) lib/earmark_parser.ex:592: EarmarkParser.as_ast/2
        (earmark 1.4.41) lib/earmark/transform.ex:249: Earmark.Transform.postprocessed_ast/2
        (earmark 1.4.41) lib/earmark/internal.ex:42: Earmark.Internal.as_html/2
        (earmark 1.4.41) lib/earmark/internal.ex:48: Earmark.Internal.as_html!/2
        ...
        (phoenix_live_view 0.19.5) lib/phoenix_live_view/engine.ex:150: Phoenix.HTML.Safe.Phoenix.LiveView.Rendered.to_iodata/1
        (phoenix_live_view 0.19.5) lib/phoenix_live_view/engine.ex:166: Phoenix.HTML.Safe.Phoenix.LiveView.Rendered.to_iodata/3
        (phoenix 1.7.7) lib/phoenix/controller.ex:1008: anonymous fn/5 in Phoenix.Controller.template_render_to_iodata/4
        (phoenix 1.7.7) lib/phoenix/controller.ex:974: Phoenix.Controller.render_and_send/4

I'm sorry I don't have a quick reproduction case, as I'm calling Earmark as a LiveView component and haven't isolated this issue out yet. Given the size/scope of the v1.4.41 merge that still not on master, figured I would give a heads up if this makes sense to someone in the know.

Other things I tried:

Version info:

RobertDober commented 11 months ago

Thank you for reporting this

RobertDober commented 11 months ago

I'm sorry I don't have a quick reproduction case, as I'm calling Earmark as a LiveView component and haven't isolated this issue out yet. Given the size/scope of the v1.4.41 merge that still not on master, figured I would give a heads up if this makes sense to someone in the know.

You reported this very nicely, I can see the stupid misstake I made, just that I am on leave and cannot really investigate why the tests did not check this. Hopefully fixed with the just released 1.4.42

Robert-Janeczek commented 11 months ago

Not fixed in 1.4.42 on Elixir 1.15.5 (compiled with Erlang/OTP 26) I'm afraid

RobertDober commented 11 months ago

~Sorry about that, will need some time to check this out, time I do not have right now. Thank you for your patience.~

How stupid can one get (please do not answer) @tercenya very nicely identified the problem by referring to #80, now I just checked #80 so this should do the trick

:blush: ๐Ÿ˜Š ๐Ÿ˜Š

nathany-copia commented 11 months ago

Thank you. It may be worth yanking 1.4.41/42 from Hex?

RobertDober commented 11 months ago

Thank you. It may be worth yanking 1.4.41/42 from Hex?

Completely agree, however can this still be done?

nathany-copia commented 11 months ago

Yes, it's possible to retire a specific version

https://hexdocs.pm/hex/Mix.Tasks.Hex.Retire.html

RobertDober commented 11 months ago

Ty for your reply, I have looked at the hex.retire and it is my understanding that it retires the whole package not a version (although I wonder why we need a version in the command, then)

So I get cold feet, honestly.

But thank you for your time.

RobertDober commented 11 months ago

I'll be a little bit more precise, I quote the doc

mix hex.retire

Retires a package version.

Great so far

Mark a package as retired when you no longer recommend its usage.

I beg you pardon ๐Ÿ˜จ

I will test with a dummy package when I have some time; probably not soon, sorry

nathany-copia commented 11 months ago

Yeah, I found it confusing too.

nathany-copia commented 11 months ago

Here's an example though:

Timex 3.6.2 https://hex.pm/packages/timex/versions

Robert-Janeczek commented 11 months ago

During one of the recent Thinking Elixir podcast it was mentioned that it can be done by asking Hex maintainers, but they have a policy limiting it to 48h after release if I'm not mistaken.

RobertDober commented 11 months ago

During one of the recent Thinking Elixir podcast it was mentioned that it can be done by asking Hex maintainers, but they have a policy limiting it to 48h after release if I'm not mistaken.

Is that not for overwriting the same version, which also can be done during 1h IIRC with the CLI.

Maybe this is one of the areas where documentation could be improved.

RobertDober commented 11 months ago

Here's an example though:

Timex 3.6.2 https://hex.pm/packages/timex/versions

Well are we sure there was ever a version 3.7.10 ? I have occasonally skipped patch version numbers.

Ty all for your participation, but I'll just test with a dummy package. ;)

RobertDober commented 11 months ago

Action : Retire versions 1.4.4[12] if savely possible.

RobertDober commented 11 months ago

DONE

RobertDober commented 11 months ago

Ty all for your help

nathany-copia commented 11 months ago

Thank you ๐Ÿ‘๐Ÿป