Environment
- Elixir:
1.20.0-rc.4-otp-28, 1.19.5-otp-28, 1.18.4-otp-28
- Phoenix:
1.7.x
- Phoenix.Sync:
0.6.1
- igniter:
0.7.7
What I did
- Created a new project:
- Added
igniter to mix.exs:
{:igniter, "~> 0.6", only: [:dev, :test]}
- Then ran:
mix igniter.install phoenix_sync --sync-mode embedded
First run result (FAILS)
Igniter adds phoenix_sync to mix.exs and compiles it, but then crashes with:
** (UndefinedFunctionError) function Phoenix.Sync.MixProject.project/0 is undefined (module Phoenix.Sync.MixProject is not available)
Phoenix.Sync.MixProject.project()
(phoenix_sync 0.6.1) lib/mix/tasks/phoenix_sync.install.ex:301: Mix.Tasks.PhoenixSync.Install.required_electric_version/0
(phoenix_sync 0.6.1) lib/mix/tasks/phoenix_sync.install.ex:123: Mix.Tasks.PhoenixSync.Install.add_dependencies/2
(igniter 0.7.7) lib/igniter/util/install.ex:187: anonymous fn/3 in Igniter.Util.Install.run_installers/5
(elixir 1.20.0-rc.4) lib/enum.ex:2617: Enum."-reduce/3-lists^foldl/2-0-"/3
(igniter 0.7.7) lib/igniter/util/install.ex:176: Igniter.Util.Install.run_installers/5
(mix 1.20.0-rc.4) lib/mix/task.ex:502: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.20.0-rc.4) lib/mix/cli.ex:129: Mix.CLI.run_task/2
At this point:
phoenix_sync has already been added to deps
- but the installer crashes before finishing
Second run (WORKS)
Without changing anything else, I run:
mix igniter.install phoenix_sync --sync-mode embedded
Now it succeeds:
- Detects
phoenix_sync already installed
- Adds
:electric
- Runs
phoenix_sync.install
- Updates config and application files correctly
Observed behavior
- First run fails because
Phoenix.Sync.MixProject is not available
|
Phoenix.Sync.MixProject.project() |
- Second run succeeds once the dependency is already compiled
What I expected
mix igniter.install phoenix_sync --sync-mode embedded to succeed on the first run
Environment
1.20.0-rc.4-otp-28,1.19.5-otp-28,1.18.4-otp-281.7.x0.6.10.7.7What I did
ignitertomix.exs:First run result (FAILS)
Igniter adds
phoenix_synctomix.exsand compiles it, but then crashes with:At this point:
phoenix_synchas already been added to depsSecond run (WORKS)
Without changing anything else, I run:
Now it succeeds:
phoenix_syncalready installed:electricphoenix_sync.installObserved behavior
Phoenix.Sync.MixProjectis not availablephoenix_sync/lib/mix/tasks/phoenix_sync.install.ex
Line 301 in aaeaef7
What I expected
mix igniter.install phoenix_sync --sync-mode embeddedto succeed on the first run