AE
Ash Elixir•2mo ago
aeons

Igniter messes with sourceror

I have a pretty empty Phoenix 1.8 project where I have added igniter, ash and ash_phoenix, using igniter, without issue. Now I want to add ash_authentication with mix igniter.install ash_authentication --auth-strategy magic_link, however that fails after setting up igniter with:
** (RuntimeError) Spark.Formatter requires sourceror to run. Please add it as a dev/test dependency

defp deps do
[
...,
{:sourceror, "~> 1.7", only: [:dev, :test]}
]

end

(rewrite 1.1.2) lib/rewrite/dot_formatter.ex:725: Rewrite.DotFormatter.format_quoted!/4
(rewrite 1.1.2) lib/rewrite/source/ex.ex:169: Rewrite.Source.Ex.update_quoted/3
(rewrite 1.1.2) lib/rewrite/source/ex.ex:157: Rewrite.Source.Ex.handle_update/4
(rewrite 1.1.2) lib/rewrite/source.ex:501: Rewrite.Source.update/4
(igniter 0.6.25) lib/igniter.ex:1680: Igniter.apply_func_with_zipper/3
(igniter 0.6.25) lib/igniter.ex:525: Igniter.update_elixir_file/4
(igniter 0.6.25) lib/igniter/util/info.ex:315: anonymous fn/4 in Igniter.Util.Info.add_deps/3
(elixir 1.19.0-rc.0) lib/enum.ex:2520: Enum."-reduce/3-lists^foldl/2-0-"/3
** (RuntimeError) Spark.Formatter requires sourceror to run. Please add it as a dev/test dependency

defp deps do
[
...,
{:sourceror, "~> 1.7", only: [:dev, :test]}
]

end

(rewrite 1.1.2) lib/rewrite/dot_formatter.ex:725: Rewrite.DotFormatter.format_quoted!/4
(rewrite 1.1.2) lib/rewrite/source/ex.ex:169: Rewrite.Source.Ex.update_quoted/3
(rewrite 1.1.2) lib/rewrite/source/ex.ex:157: Rewrite.Source.Ex.handle_update/4
(rewrite 1.1.2) lib/rewrite/source.ex:501: Rewrite.Source.update/4
(igniter 0.6.25) lib/igniter.ex:1680: Igniter.apply_func_with_zipper/3
(igniter 0.6.25) lib/igniter.ex:525: Igniter.update_elixir_file/4
(igniter 0.6.25) lib/igniter/util/info.ex:315: anonymous fn/4 in Igniter.Util.Info.add_deps/3
(elixir 1.19.0-rc.0) lib/enum.ex:2520: Enum."-reduce/3-lists^foldl/2-0-"/3
After this, mix format fails with the same error, until you run mix deps.get. This fixes mix format, but mix igniter.install ... breaks it again. Any ideas?
7 Replies
sevenseacat
sevenseacat•2mo ago
installing ash with igniter should have added sourcerer as a dependency in that way, did it not?
aeons
aeonsOP•2mo ago
Sorry, that pretty crucial part was missing: sourceror is installed and if I run Code.ensure_loaded?(Sourceror) in iex -S mix I get a true back however, I just tried using elixir 1.18.4 and that seems to have solved the issue
sevenseacat
sevenseacat•2mo ago
sourcerer was already installed in dev,test like that?
aeons
aeonsOP•2mo ago
yes from when ash was added
sevenseacat
sevenseacat•2mo ago
🤔
aeons
aeonsOP•2mo ago
and if I do a Code.ensure_loaded in iex then mix format works afterwards but it feels like it might be an elixir 1.19 issue I'll see if I can reproduce it I can't reproduce it in a fresh project I'll close this one
zimt28
zimt28•2mo ago
rm -rf _build fixes most weird Elixir issues 😅

Did you find this page helpful?