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

** (FunctionClauseError) no function clause matching in ExDoc.Utils.source_url_pattern/3 #1689

Closed
restlessronin opened this issue Apr 18, 2023 · 3 comments

Comments

@restlessronin
Copy link

restlessronin commented Apr 18, 2023

As of today, mix docs is failing on my public repo https://github.com/restlessronin/openai_ex

The development is happening inside a livebook docker container (0.9.2) running in a VS Code devcontainer (the repo is set up for this).

The error can be reproduced by cloning the repo, opening it in a dev container, and running 'mix docs' in the terminal.

It was working on an earlier version of the same file.

As a result of this bug, I am unable to upload the latest version of the library to hexpm.

@restlessronin
Copy link
Author

the full message is

$ mix docs
Generating docs...
** (FunctionClauseError) no function clause matching in ExDoc.Utils.source_url_pattern/3    
    
    The following arguments were given to ExDoc.Utils.source_url_pattern/3:
    
        # 1
        "https://github.com/restlessronin/openai_ex/blob/v0.1.2/%{path}#L%{line}"
    
        # 2
        "lib/openai_ex/audio.ex"
    
        # 3
        nil
    
    Attempted function clauses (showing 1 out of 1):
    
        def source_url_pattern(source_url_pattern, path, line) when is_binary(path) and is_integer(line)
    
    (ex_doc 0.29.4) lib/ex_doc/utils.ex:135: ExDoc.Utils.source_url_pattern/3
    (ex_doc 0.29.4) lib/ex_doc/retriever.ex:141: ExDoc.Retriever.generate_node/3
    (ex_doc 0.29.4) lib/ex_doc/retriever.ex:57: ExDoc.Retriever.get_module/2
    (elixir 1.14.2) lib/enum.ex:4249: Enum.flat_map_list/2
    (ex_doc 0.29.4) lib/ex_doc/retriever.ex:36: ExDoc.Retriever.docs_from_modules/2
    (ex_doc 0.29.4) lib/ex_doc.ex:24: ExDoc.generate_docs/3
    (ex_doc 0.29.4) lib/mix/tasks/docs.ex:381: anonymous fn/7 in Mix.Tasks.Docs.run/3
    (elixir 1.14.2) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3

@josevalim
Copy link
Member

You are removing debug_info from your modules in your mix.exs, which means it can't find the relevant line numbers and so on. You should keep debug_info in docs too but note there is no reason to remove debug_info at all. When building a release, the debug info is automatically removed. I will improve the error message in ExDoc.

@restlessronin
Copy link
Author

wow! that was fast. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants