You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
18:40:25.639 [info] Application telemetry exited: :stopped
** (MatchError) no match of right hand side value: {:error, {:jason, {'no such file or directory', 'jason.app'}}}
(ecto_sql) lib/mix/ecto_sql.ex:9: Mix.EctoSQL.ensure_started/2
(ecto_sql) lib/mix/tasks/ecto.migrations.ex:43: anonymous fn/3 in Mix.Tasks.Ecto.Migrations.run/3
(elixir) lib/enum.ex:1327: Enum."-map/2-lists^map/1-0-"/2
(ecto_sql) lib/mix/tasks/ecto.migrations.ex:40: Mix.Tasks.Ecto.Migrations.run/3
(mix) lib/mix/task.ex:331: Mix.Task.run_task/3
(mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2
mix ecto.migrations/ecto.reset e.t.c. show the same issue.
Notes
This has been bugging me all day. I created an umbrella phoenix project and 9/10 times when it comes to migrations (and similar mix commands) I get this error. If i delete the _build directory then compile only the ecto app then migrations work. If i compile from the umbrella root or the web app then migrations fail with the above error.
The actual solution seems to be to add {:jason, "~> 1.0"} to the mix deps for the ecto app but in previous versions i've never had to do this.
Thanks, @josevalim. I just tested it and it does indeed work (not that I ever doubted you haha). So are you suggesting the umbrella templates should be modified to include the jason dependancy by default? If so what is it being used for if the ecto app now works without the dependancy?
@mainlymortal the reason to add jason is because if you want to use a :map field (which requires a JSON lib) then it will already be there. Also, we already include jason in the web app, so it is not like it will make a big difference to have it in both at the end of the day.
Activity
josevalim commentedon Jan 29, 2019
This is a bug in Elixir but Phoenix should likely consider adding :jason as a dependency to the ecto app too.
josevalim commentedon Jan 30, 2019
Fixed on Elixir v1.8.1 but, as said, I would recommend adding jason as a dep in the ecto app too. 👍 Thanks for the report!
mainlymortal commentedon Jan 30, 2019
Thanks, @josevalim. I just tested it and it does indeed work (not that I ever doubted you haha). So are you suggesting the umbrella templates should be modified to include the jason dependancy by default? If so what is it being used for if the ecto app now works without the dependancy?
josevalim commentedon Jan 30, 2019
:D
@mainlymortal the reason to add jason is because if you want to use a :map field (which requires a JSON lib) then it will already be there. Also, we already include jason in the web app, so it is not like it will make a big difference to have it in both at the end of the day.
Add jason to umbrella ecto deps. Fixes #3263
Merge remote-tracking branch 'phx/master'