parroty / exvcr

HTTP request/response recording library for elixir, inspired by VCR.
MIT License
724 stars 132 forks source link

Version `0.14.0` cannot be compiled in projects not using `Finch` #204

Closed nonninz closed 1 year ago

nonninz commented 1 year ago

Hello,

Since 0.14.0 ex_vcr cannot be compiled in projects that do not use Finch:

== Compilation error in file lib/exvcr/adapter/finch/converter.ex ==
Error: ** (CompileError) lib/exvcr/adapter/finch/converter.ex:67: Finch.Response.__struct__/0 is undefined, cannot expand struct Finch.Response. Make sure the struct name is correct. If the struct name exists and is correct but it still cannot be found, you likely have cyclic module usage in your code
    expanding struct: Finch.Response.__struct__/0
    lib/exvcr/adapter/finch/converter.ex:67: ExVCR.Adapter.Finch.Converter.response_to_string/1
could not compile dependency :exvcr, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile exvcr", update it with "mix deps.update exvcr" or clean it with "mix deps.clean exvcr"
Error: Process completed with exit code 1.

I think the module ExVCR.Adapter.Finch.Converter should also be wrapped in if Code.ensure_loaded?(Finch) like ExVCR.Adapter.Finch.

Thank you :)