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 IO.chardata_to_string/1 #275

Open
kianmeng opened this issue Dec 31, 2021 · 3 comments

Comments

@kianmeng
Copy link
Contributor

Steps to reproduce this:

git clone https://github.com/devinus/poison.git
cd poison
asdf install
mix deps.get
mix coveralls.github

Stacktrace:

** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1          
                                                                                          
    The following arguments were given to IO.chardata_to_string/1:      
                                                                                          
        # 1                                                                               
        nil                                                                               
                                                                                          
    Attempted function clauses (showing 2 out of 2):          
                                             
        def chardata_to_string(string) when is_binary(string)
        def chardata_to_string(list) when is_list(list)
     
    (elixir 1.13.0-rc.1) lib/io.ex:627: IO.chardata_to_string/1
    (elixir 1.13.0-rc.1) lib/file.ex:341: File.read/1
    (elixir 1.13.0-rc.1) lib/file.ex:350: File.read!/1
    (excoveralls 0.14.4) lib/excoveralls/github.ex:84: ExCoveralls.Github.event_info/0
    (excoveralls 0.14.4) lib/excoveralls/github.ex:56: ExCoveralls.Github.get_committer_na
me/0
    (excoveralls 0.14.4) lib/excoveralls/github.ex:93: ExCoveralls.Github.git_info/0
    (excoveralls 0.14.4) lib/excoveralls/github.ex:25: ExCoveralls.Github.generate_json/2
    (excoveralls 0.14.4) lib/excoveralls/github.ex:8: ExCoveralls.Github.execute/2
    (mix 1.13.0-rc.1) lib/mix/tasks/test.ex:537: Mix.Tasks.Test.do_run/3
    (mix 1.13.0-rc.1) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (excoveralls 0.14.4) lib/mix/tasks.ex:54: Mix.Tasks.Coveralls.do_run/2
    (mix 1.13.0-rc.1) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.0-rc.1) lib/mix/cli.ex:84: Mix.CLI.run_task/2
    (elixir 1.13.0-rc.1) lib/code.ex:1183: Code.require_file/2
@duane-strikwerda
Copy link

I think you might be experiencing a duplicate of this issue

@kianmeng
Copy link
Contributor Author

kianmeng commented Jan 7, 2022

@duane-strikwerda Thanks. Error message seemed similar but I think I was running mix coveralls.github locally, exception was raised because required GitHub environment variable was not found.

@parroty Okay to switch to System.fetch_env!/1 in github.ex?

   31   defp get_env!(env) do
   32     env
   33     |> System.fetch_env!
   34   end

So the exception will give us a more specific error? Something like below:

** (ArgumentError) could not fetch environment variable "GITHUB_EVENT_PATH" because it is 
not set

@anrgl
Copy link

anrgl commented Apr 23, 2023

Hi @kianmeng! Were you able to run on githab without this error?

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

3 participants