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 #273

Closed
duane-strikwerda opened this issue Dec 10, 2021 · 9 comments

Comments

@duane-strikwerda
Copy link

Hello:

Phoenix 1.5.13
erlang 24.1.7 [erts-12.1.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
elixir 1.13.0-otp-24 (compiled with Erlang/OTP 24)
excoveralls 0.14.0

(Windows running WSL 2)

MIX_ENV=test mix coveralls.html

excoveralls error

ExCoveralls was working just fine on elixir 1.12.2 - but seems to have stopped, I am unsure if it is the upgrade, or ?

Any thoughts/hints would be a great help

Thanks
-d

@MrGrinst
Copy link

MrGrinst commented Dec 10, 2021

Seeing this same issue on elixir 1.13.0 and excoveralls 1.13.4

Excluding tags: [:integration_test]
.....................................
Finished in 0.6 seconds (0.6s async, 0.00s sync)
7 doctests, 30 tests, 0 failures
Randomized with seed 375316
Wrote JUnit report to: /app/_build/test/lib/shared_db-junit.xml
** (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) lib/io.ex:627: IO.chardata_to_string/1
    (elixir 1.13.0) lib/path.ex:423: Path.dirname/1
    lib/excoveralls/cover.ex:21: ExCoveralls.Cover.module_path/1
    lib/excoveralls/stats.ex:54: ExCoveralls.Stats.add_counts/4
    (elixir 1.13.0) lib/enum.ex:2396: Enum."-reduce/3-lists^foldl/2-0-"/3
    lib/excoveralls/stats.ex:28: ExCoveralls.Stats.report/1
    lib/excoveralls.ex:45: ExCoveralls.execute/2
    (mix 1.13.0) lib/mix/tasks/test.ex:538: Mix.Tasks.Test.do_run/3
    (mix 1.13.0) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.0) lib/mix/task.ex:451: Mix.Task.run_alias/5
    (mix 1.13.0) lib/mix/project.ex:396: Mix.Project.in_project/4
    (elixir 1.13.0) lib/file.ex:1560: File.cd!/2
    (mix 1.13.0) lib/mix/task.ex:531: anonymous fn/4 in Mix.Task.recur/1
    (elixir 1.13.0) lib/enum.ex:2396: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.13.0) lib/mix/task.ex:530: Mix.Task.recur/1
    (mix 1.13.0) lib/mix/project_stack.ex:221: Mix.ProjectStack.recur/1
    (mix 1.13.0) lib/mix/task.ex:451: Mix.Task.run_alias/5
    lib/mix/tasks.ex:54: Mix.Tasks.Coveralls.do_run/2
    (mix 1.13.0) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.0) lib/mix/task.ex:455: Mix.Task.run_alias/5

@christhekeele
Copy link

christhekeele commented Dec 15, 2021

Can confirm I'm getting this as well! All versions of 1.13, no matter the otp I use.

@ryanzidago
Copy link

Can confirm as well. As soon as I updated to Elixir 1.13.0 and Erlang 24.0.1, I saw the above mentioned error.

@sudoku-lord
Copy link

Yup, I third this. Had the same issue with Erlang 24.0 and Elixir 1.13 (on the command line, at least). Bumped down to Erlang 22.0 and 1.12 and it ran just fine in my GitHub Action.

@parroty
Copy link
Owner

parroty commented Dec 21, 2021

Thank you for the report. I'm struggling to reproduce the error, but I'm wondering if the following change might be related.
The error still occurs with excoveralls v0.14.4? (If it's older than this version, is it possible to try with v0.14.4?).

@christhekeele
Copy link

christhekeele commented Dec 21, 2021

I just walked through the latest versions—it does indeed work on v0.14.4 but nothing earlier in the v0.14 line. In fact, fixing this was exactly what was released in the version bump, see the diff and PR. I'll admit I'm not sure what properties of my test suite trigger this error that has been around for 3 patch versions.

So I'd say this is not a duplicate of #271, since no issue was ever opened for it, but more or less the corresponding error report. The fix is to upgrade to excoveralls v0.14.0.

I did this while still retaining the ~> semantics of my "~> 0.14.0" dependency requirement by changing it to:

{:excoveralls, "~> 0.14 and >= 0.14.4", only: [:dev, :test]}

@parroty maybe this should be what it in the README.md to steer others to upgrading past this bug state?

@duane-strikwerda
Copy link
Author

mix deps.update excoveralls

resulted in:

Upgraded:
  excoveralls 0.14.2 => 0.14.4
  jason 1.2.2 => 1.3.0
* Updating jason (Hex package)
* Updating excoveralls (Hex package)

which seems to have fixed the issue!

Many thanks again!

@ks1venberg
Copy link

Thank you for the report. I'm struggling to reproduce the error, but I'm wondering if the following change might be related. The error still occurs with excoveralls v0.14.4? (If it's older than this version, is it possible to try with v0.14.4?).

Thank you! The problem was solved by installing v 0.14.4
In mix.exs I've assigned: {:excoveralls, ">= 0.14.0"}

@christhekeele
Copy link

@ks1venberg do be careful with with {:excoveralls, ">= 0.14.0"}, as that will eagerly install any update, including major breaking versions. I'd recommending pinning it to something with ~> as described in the version docs.

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

7 participants