Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module EarmarkParse is not available or is yet to be defined #16

Open
ThunderHeavyIndustries opened this issue Feb 9, 2024 · 0 comments

Comments

@ThunderHeavyIndustries
Copy link

Pulled this in to a clean phoenix app tonight and going through the setup instructions I was getting an error:

== Compilation error in file lib/<redacted>/router.ex ==
** (UndefinedFunctionError) function EarmarkParser.as_ast/2 is undefined (module EarmarkParser is not available)
    EarmarkParser.as_ast("\n", [gfm: true, gfm_tables: true, file: "priv/pages/hello.md", breaks: false, sub_sup: true, wikilinks: true, pure_links: true, footnotes: true, code_class_prefix: nil])
    (phoenix_pages 0.1.1) lib/phoenix_pages/markdown.ex:43: PhoenixPages.Markdown.render/3
    lib/<redacted>/router.ex:21: anonymous fn/5 in :elixir_compiler_5.__MODULE__/1
    (elixir 1.16.0) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    lib/<redacted>/router.ex:21: (module)
    (elixir 1.16.0) lib/kernel/parallel_compiler.ex:428: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/8
Compiling 1 file (.ex)

when running mix.deps.compile it made things a bit clearer:

==> phoenix_pages
Compiling 1 file (.ex)
    warning: EarmarkParse.as_ast/2 is undefined (module EarmarkParse is not available or is yet to be defined)
    │
 43 │       case EarmarkParse.as_ast(contents, parser_opts) do
    │                         ~
    │
    └─ (phoenix_pages 0.1.1) lib/phoenix_pages/markdown.ex:43:25: PhoenixPages.Markdown.render/3

adjusting the call in phoenix-pages/lib/phoenix_pages/markdown.ex on line 43 from

case EarmarkParser.as_ast(contents, parser_opts) do

to

case Earmark.Parser.as_ast(contents, parser_opts) do

seemed to fix things for me

thotmx added a commit to thotmx/phoenix-pages that referenced this issue Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant