Skip to content

Installing Ash using mix igniter install ash causes Protocol.UndefinedError #268

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

Open
jaeyson opened this issue Apr 14, 2025 · 5 comments
Open
Labels
bug Something isn't working

Comments

@jaeyson
Copy link

jaeyson commented Apr 14, 2025

Describe the bug
installing Ash using mix igniter install ash causes Protocol.UndefinedError.

** (Protocol.UndefinedError) protocol Enumerable not implemented for type Rewrite (a struct). This protocol is implemented for the following type(s): DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, Jason.OrderedObject, List, Map, MapSet, Phoenix.LiveView.LiveStream, Postgrex.Stream, Range, Req.Response.Async, Stream

Got value:

    %Rewrite{
      sources: %{
        "config/config.exs" => %Rewrite.Source{
          from: :file,
          path: "config/config.exs",
          content: "# This file is responsible for configuring your application\n# and its dependencies with the aid of the Config module.\n#\n# This configuration file is loaded before any dependency and\n# is restricted to this project.\n\n# General application configuration\nimport Config\n\nconfig :my_app,\n  ecto_repos: [MyApp.Repo],\n  generators: [timestamp_type: :utc_datetime, binary_id: true]\n\n# Configures the endpoint\nconfig :my_app, MyAppWeb.Endpoint,\n  url: [host: \"localhost\"],\n  adapter: Bandit.PhoenixAdapter,\n  render_errors: [\n    formats: [html: MyAppWeb.ErrorHTML, json: MyAppWeb.ErrorJSON],\n    layout: false\n  ],\n  pubsub_server: MyApp.PubSub,\n  live_view: [signing_salt: \"NRsrxCo5\"]\n\n# Configures the mailer\n#\n# By default it uses the \"Local\" adapter which stores the emails\n# locally. You can see the emails in your browser, at \"/dev/mailbox\".\n#\n# For production it's recommended to configure a different adapter\n# at the `config/runtime.exs`.\nconfig :my_app, MyApp.Mailer, adapter: Swoosh.Adapters.Local\n\n# Configure esbuild (the version is required)\nconfig :esbuild,\n  version: \"1.17.11\",\n  my_app: [\n    args:\n      ~w(js/app.js --bundle --target=es2022 --outdir=../priv/static/assets/js --external:/fonts/* --external:/images/*),\n    cd: Path.expand(\"../assets\", __DIR__),\n    env: %{\"NODE_PATH\" => Path.expand(\"../deps\", __DIR__)}\n  ]\n\n# Configure tailwind (the version is required)\nconfig :tailwind,\n  version: \"4.0.9\",\n  my_app: [\n    args: ~w(\n      --input=assets/css/app.css\n      --output=priv/static/assets/css/app.css\n    ),\n    cd: Path.expand(\"..\", __DIR__)\n  ]\n\n# Configures Elixir's Logger\nconfig :logger, :default_formatter,\n  format: \"$time $metadata[$level] $message\\n\",\n  metadata: [:request_id]\n\n# Use Jason for JSON parsing in Phoenix\nconfig :phoenix, :json_library, Jason\n\n# Import environment specific config. This must remain at the bottom\n# of this file so it overrides the configuration defined above.\nimport_config \"\#{config_env()}.exs\"\n",
          hash: 55228669,
          owner: Rewrite,
          filetype: %Rewrite.Source.Ex{
            quoted: {:__block__, [trailing_comments: [], leading_comments: []],
             [
               ***REDACTED DUE TO GITHUB'S LINES LIMIT***
          private: %{}
        },
        "config/dev.exs" => %Rewrite.Source{
          from: :file,
          path: "config/dev.exs",
          content: "import Config\n\n# Configure your database\nconfig :my_app, MyApp.Repo,\n  username: \"postgres\",\n  password: \"postgres\",\n  hostname: \"localhost\",\n  database: \"my_app_dev\",\n  stacktrace: true,\n  show_sensitive_data_on_connection_error: true,\n  pool_size: 10\n\n# For development, we disable any cache and enable\n# debugging and code reloading.\n#\n# The watchers configuration can be used to run external\n# watchers to your application. For example, we can use it\n# to bundle .js and .css sources.\nconfig :my_app, MyAppWeb.Endpoint,\n  # Binding to loopback ipv4 address prevents access from other machines.\n  # Change to `ip: {0, 0, 0, 0}` to allow access from other machines.\n  http: [ip: {127, 0, 0, 1}, port: 4000],\n  check_origin: false,\n  code_reloader: true,\n  debug_errors: true,\n  secret_key_base: \"AQQ3YJyGUSYpUMGfrDikXeZ8fim4ouTQhNLDfo6o2qd2sdrkeSDTZJOc3ZY6zNQF\",\n  watchers: [\n    esbuild: {Esbuild, :install_and_run, [:my_app, ~w(--sourcemap=inline --watch)]},\n    tailwind: {Tailwind, :install_and_run, [:my_app, ~w(--watch)]}\n  ]\n\n# ## SSL Support\n#\n# In order to use HTTPS in development, a self-signed\n# certificate can be generated by running the following\n# Mix task:\n#\n#     mix phx.gen.cert\n#\n# Run `mix help phx.gen.cert` for more information.\n#\n# The `http:` config above can be replaced with:\n#\n#     https: [\n#       port: 4001,\n#       cipher_suite: :strong,\n#       keyfile: \"priv/cert/selfsigned_key.pem\",\n#       certfile: \"priv/cert/selfsigned.pem\"\n#     ],\n#\n# If desired, both `http:` and `https:` keys can be\n# configured to run both http and https servers on\n# different ports.\n\n# Watch static and templates for browser reloading.\nconfig :my_app, MyAppWeb.Endpoint,\n  live_reload: [\n    web_console_logger: true,\n    patterns: [\n      ~r\"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$\",\n      ~r\"priv/gettext/.*(po)$\",\n      ~r\"lib/my_app_web/(controllers|live|components)/.*(ex|heex)$\"\n    ]\n  ]\n\n# Enable dev routes for dashboard and mailbox\nconfig :my_app, dev_routes: true\n\n# Do not include metadata nor timestamps in development logs\nconfig :logger, :default_formatter, format: \"[$level] $message\\n\"\n\n# Set a higher stacktrace during development. Avoid configuring such\n# in production as building large stacktraces may be expensive.\nconfig :phoenix, :stacktrace_depth, 20\n\n# Initialize plugs at runtime for faster development compilation\nconfig :phoenix, :plug_init_mode, :runtime\n\nconfig :phoenix_live_view,\n  # Include HEEx debug annotations as HTML comments in rendered markup.\n  # Changing this configuration will require mix clean and a full recompile.\n  debug_heex_annotations: true,\n  # Enable helpful, but potentially expensive runtime checks\n  enable_expensive_runtime_checks: true\n\n# Disable swoosh api client as it is only required for production adapters.\nconfig :swoosh, :api_client, false\n",
          hash: 24778322,
          owner: Rewrite,
          filetype: %Rewrite.Source.Ex{
            quoted: {:__block__, [trailing_comments: [], leading_comments: []],
             ***REDACTED DUE TO GITHUB'S LINES LIMIT***
        "mix.exs" => %Rewrite.Source{
          from: :file,
          path: "mix.exs",
          content: "defmodule MyApp.MixProject do\n  use Mix.Project\n\n  def project do\n    [\n      app: :my_app,\n      version: \"0.1.0\",\n      elixir: \"~> 1.15\",\n      elixirc_paths: elixirc_paths(Mix.env()),\n      start_permanent: Mix.env() == :prod,\n      aliases: aliases(),\n      deps: deps(),\n      listeners: [Phoenix.CodeReloader]\n    ]\n  end\n\n  # Configuration for the OTP application.\n  #\n  # Type `mix help compile.app` for more information.\n  def application do\n    [\n      mod: {MyApp.Application, []},\n      extra_applications: [:logger, :runtime_tools]\n    ]\n  end\n\n  # Specifies which paths to compile per environment.\n  defp elixirc_paths(:test), do: [\"lib\", \"test/support\"]\n  defp elixirc_paths(_), do: [\"lib\"]\n\n  # Specifies your project dependencies.\n  #\n  # Type `mix help deps` for examples and options.\n  defp deps do\n    [\n      {:phoenix, \"~> 1.8.0-rc.0\", override: true},\n      {:phoenix_ecto, \"~> 4.5\"},\n      {:ecto_sql, \"~> 3.10\"},\n      {:postgrex, \">= 0.0.0\"},\n      {:phoenix_html, \"~> 4.1\"},\n      {:phoenix_live_reload, \"~> 1.2\", only: :dev},\n      {:phoenix_live_view, \"~> 1.0\"},\n      {:floki, \">= 0.30.0\", only: :test},\n      {:phoenix_live_dashboard, \"~> 0.8.3\"},\n      {:esbuild, \"~> 0.9\", runtime: Mix.env() == :dev},\n      {:tailwind, \"~> 0.3\", runtime: Mix.env() == :dev},\n      {:heroicons,\n       github: \"tailwindlabs/heroicons\",\n       tag: \"v2.1.1\",\n       sparse: \"optimized\",\n       app: false,\n       compile: false,\n       depth: 1},\n      {:swoosh, \"~> 1.16\"},\n      {:req, \"~> 0.5\"},\n      {:telemetry_metrics, \"~> 1.0\"},\n      {:telemetry_poller, \"~> 1.0\"},\n      {:gettext, \"~> 0.26\"},\n      {:jason, \"~> 1.2\"},\n      {:dns_cluster, \"~> 0.1.1\"},\n      {:bandit, \"~> 1.5\"},\n      {:credo, \"~> 1.7\", only: [:dev, :test], runtime: false},\n      {:igniter, \"~> 0.5\", only: [:dev, :test]}\n    ]\n  end\n\n  # Aliases are shortcuts or tasks specific to the current project.\n  # For example, to install project dependencies and perform other setup tasks, run:\n  #\n  #     $ mix setup\n  #\n  # See the documentation for `Mix` for more info on aliases.\n  defp aliases do\n    [\n      setup: [\"deps.get\", \"ecto.setup\", \"assets.setup\", \"assets.build\"],\n      \"ecto.setup\": [\"ecto.create\", \"ecto.migrate\", \"run priv/repo/seeds.exs\"],\n      \"ecto.reset\": [\"ecto.drop\", \"ecto.setup\"],\n      test: [\"ecto.create --quiet\", \"ecto.migrate --quiet\", \"test\"],\n      \"assets.setup\": [\"tailwind.install --if-missing\", \"esbuild.install --if-missing\"],\n      \"assets.build\": [\"tailwind my_app\", \"esbuild my_app\"],\n      \"assets.deploy\": [\n        \"tailwind my_app --minify\",\n        \"esbuild my_app --minify\",\n        \"phx.digest\"\n      ]\n    ]\n  end\nend\n",
          hash: 111702152,
          owner: Rewrite,
          filetype: %Rewrite.Source.Ex{
            quoted: {:defmodule,
             [
               trailing_comments: [],
               leading_comments: [],
               end_of_expression: [newlines: 1, line: 88, column: 4],
               do: [line: 1, column: 28],
               end: [line: 88, column: 1],
               line: 1,
               column: 1
             ],
             [
               {:__aliases__,
                [
                  trailing_comments: [],
                  leading_comments: [],
                  last: [line: 1, column: 17],
                  line: 1,
                  column: 11
                ], [:MyApp, :MixProject]},
               [
                 {{:__block__,
                   [
                     trailing_comments: [],
                     leading_comments: [],
                     line: 1,
                     column: 28
                   ], [:do]},
                  {:__block__, [trailing_comments: [], leading_comments: []],
                   [
                     {:use,
                      [
                        trailing_comments: [],
                        leading_comments: [],
                        end_of_expression: [newlines: 2, line: 2, column: 18],
                        line: 2,
                        column: 3
                      ],
                      [
                        {:__aliases__,
                         [
                           trailing_comments: [],
                           leading_comments: [],
                           last: [line: 2, column: 11],
                           line: 2,
                           column: 7
                         ], [:Mix, :Project]}
                      ]},
                     {:def,
                      [
                        trailing_comments: [],
                        leading_comments: [],
                        end_of_expression: [newlines: 1, line: 15, column: 6],
                        do: [line: 4, column: 15],
                        end: [line: 15, column: 3],
                        line: 4,
                        column: 3
                      ],
                      [
                        {:project,
                         [
                           trailing_comments: [],
                           leading_comments: [],
                           line: 4,
                           column: 7
                         ], nil},
                        [
                          {{:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              line: 4,
                              column: 15
                            ], [:do]},
                           {:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              end_of_expression: [newlines: 1, line: 14, column: 6],
                              newlines: 1,
                              closing: [line: 14, column: 5],
                              line: 5,
                              column: 5
                            ],
                            [
                              [
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    line: 6,
                                    column: 7
                                  ], [:app]},
                                 {:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    line: 6,
                                    column: 12
                                  ], [:my_app]}},
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    line: 7,
                                    column: 7
                                  ], [:version]},
                                 {:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    delimiter: "\"",
                                    line: 7,
                                    column: 16
                                  ], ["0.1.0"]}},
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    line: 8,
                                    column: 7
                                  ], [:elixir]},
                                 {:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    delimiter: "\"",
                                    line: 8,
                                    column: 15
                                  ], ["~> 1.15"]}},
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    line: 9,
                                    column: 7
                                  ], [:elixirc_paths]},
                                 {:elixirc_paths,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    closing: [line: 9, column: 45],
                                    line: 9,
                                    column: 22
                                  ],
                                  [
                                    {{:., [trailing_comments: [], ...], [...]},
                                     [
                                       trailing_comments: [],
                                       leading_comments: [],
                                       ...
                                     ], []}
                                  ]}},
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    line: 10,
                                    column: 7
                                  ], [:start_permanent]},
                                 {:==,
                                  [trailing_comments: [], line: 10, column: 34],
                                  [
                                    {{:., [...], ...}, [trailing_comments: [], ...],
                                     []},
                                    {:__block__, [...], ...}
                                  ]}},
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    line: 11,
                                    column: 7
                                  ], [:aliases]},
                                 {:aliases,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    closing: [line: 11, ...],
                                    line: 11,
                                    ...
                                  ], []}},
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    line: 12,
                                    ...
                                  ], [:deps]},
                                 {:deps,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    closing: [...],
                                    ...
                                  ], []}},
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    ...
                                  ], [:listeners]},
                                 {:__block__,
                                  [trailing_comments: [], leading_comments: [], ...],
                                  [[...]]}}
                              ]
                            ]}}
                        ]
                      ]},
                     {:def,
                      [
                        trailing_comments: [],
                        leading_comments: [
                          %{
                            line: 17,
                            text: "# Configuration for the OTP application.",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 2
                          },
                          %{
                            line: 18,
                            text: "#",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 1
                          },
                          %{
                            line: 19,
                            text: "# Type `mix help compile.app` for more information.",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 1
                          }
                        ],
                        end_of_expression: [newlines: 1, line: 25, column: 6],
                        do: [line: 20, column: 19],
                        end: [line: 25, column: 3],
                        line: 20,
                        column: 3
                      ],
                      [
                        {:application,
                         [
                           trailing_comments: [],
                           leading_comments: [],
                           line: 20,
                           column: 7
                         ], nil},
                        [
                          {{:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              line: 20,
                              column: 19
                            ], [:do]},
                           {:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              end_of_expression: [newlines: 1, line: 24, column: 6],
                              newlines: 1,
                              closing: [line: 24, column: 5],
                              line: 21,
                              column: 5
                            ],
                            [
                              [
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    line: 22,
                                    column: 7
                                  ], [:mod]},
                                 {:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    closing: [line: 22, column: 34],
                                    line: 22,
                                    column: 12
                                  ],
                                  [
                                    {{:__aliases__,
                                      [
                                        trailing_comments: [],
                                        leading_comments: [],
                                        last: [...],
                                        ...
                                      ], [:MyApp, :Application]},
                                     {:__block__,
                                      [
                                        trailing_comments: [],
                                        leading_comments: [],
                                        ...
                                      ], [[]]}}
                                  ]}},
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    line: 23,
                                    column: 7
                                  ], [:extra_applications]},
                                 {:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    closing: [line: 23, column: 51],
                                    line: 23,
                                    column: 27
                                  ],
                                  [
                                    [
                                      {:__block__,
                                       [
                                         trailing_comments: [],
                                         leading_comments: [],
                                         ...
                                       ], [:logger]},
                                      {:__block__, [trailing_comments: [], ...],
                                       [...]}
                                    ]
                                  ]}}
                              ]
                            ]}}
                        ]
                      ]},
                     {:defp,
                      [
                        trailing_comments: [],
                        leading_comments: [
                          %{
                            line: 27,
                            text: "# Specifies which paths to compile per environment.",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 2
                          }
                        ],
                        end_of_expression: [newlines: 1, line: 28, column: 57],
                        line: 28,
                        column: 3
                      ],
                      [
                        {:elixirc_paths,
                         [
                           trailing_comments: [],
                           leading_comments: [],
                           closing: [line: 28, column: 27],
                           line: 28,
                           column: 8
                         ],
                         [
                           {:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              line: 28,
                              column: 22
                            ], [:test]}
                         ]},
                        [
                          {{:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              format: :keyword,
                              line: 28,
                              column: 30
                            ], [:do]},
                           {:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              closing: [line: 28, column: 56],
                              line: 28,
                              column: 34
                            ],
                            [
                              [
                                {:__block__,
                                 [
                                   trailing_comments: [],
                                   leading_comments: [],
                                   delimiter: "\"",
                                   line: 28,
                                   column: 35
                                 ], ["lib"]},
                                {:__block__,
                                 [
                                   trailing_comments: [],
                                   leading_comments: [],
                                   delimiter: "\"",
                                   line: 28,
                                   column: 42
                                 ], ["test/support"]}
                              ]
                            ]}}
                        ]
                      ]},
                     {:defp,
                      [
                        trailing_comments: [],
                        leading_comments: [],
                        end_of_expression: [newlines: 1, line: 29, column: 37],
                        line: 29,
                        column: 3
                      ],
                      [
                        {:elixirc_paths,
                         [
                           trailing_comments: [],
                           leading_comments: [],
                           closing: [line: 29, column: 23],
                           line: 29,
                           column: 8
                         ],
                         [
                           {:_,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              line: 29,
                              column: 22
                            ], nil}
                         ]},
                        [
                          {{:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              format: :keyword,
                              line: 29,
                              column: 26
                            ], [:do]},
                           {:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              closing: [line: 29, column: 36],
                              line: 29,
                              column: 30
                            ],
                            [
                              [
                                {:__block__,
                                 [
                                   trailing_comments: [],
                                   leading_comments: [],
                                   delimiter: "\"",
                                   line: 29,
                                   column: 31
                                 ], ["lib"]}
                              ]
                            ]}}
                        ]
                      ]},
                     {:defp,
                      [
                        trailing_comments: [],
                        leading_comments: [
                          %{
                            line: 31,
                            text: "# Specifies your project dependencies.",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 2
                          },
                          %{
                            line: 32,
                            text: "#",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 1
                          },
                          %{
                            line: 33,
                            text: "# Type `mix help deps` for examples and options.",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 1
                          }
                        ],
                        end_of_expression: [newlines: 1, line: 65, column: 6],
                        do: [line: 34, column: 13],
                        end: [line: 65, column: 3],
                        line: 34,
                        column: 3
                      ],
                      [
                        {:deps,
                         [
                           trailing_comments: [],
                           leading_comments: [],
                           line: 34,
                           column: 8
                         ], nil},
                        [
                          {{:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              line: 34,
                              column: 13
                            ], [:do]},
                           {:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              end_of_expression: [newlines: 1, line: 64, column: 6],
                              newlines: 1,
                              closing: [line: 64, column: 5],
                              line: 35,
                              column: 5
                            ],
                            [
                              [
                                {:{},
                                 [
                                   trailing_comments: [],
                                   leading_comments: [],
                                   closing: [line: 36, column: 49],
                                   line: 36,
                                   column: 7
                                 ],
                                 [
                                   {:__block__,
                                    [
                                      trailing_comments: [],
                                      leading_comments: [],
                                      line: 36,
                                      ...
                                    ], [:phoenix]},
                                   {:__block__,
                                    [
                                      trailing_comments: [],
                                      leading_comments: [],
                                      ...
                                    ], ["~> 1.8.0-rc.0"]},
                                   [{{:__block__, ...}, {...}}]
                                 ]},
                                {:__block__,
                                 [
                                   trailing_comments: [],
                                   leading_comments: [],
                                   closing: [line: 37, column: 31],
                                   line: 37,
                                   column: 7
                                 ],
                                 [
                                   {{:__block__, [trailing_comments: [], ...],
                                     [...]}, {:__block__, [...], ...}}
                                 ]},
                                {:__block__,
                                 [
                                   trailing_comments: [],
                                   leading_comments: [],
                                   closing: [line: 38, column: 28],
                                   line: 38,
                                   column: 7
                                 ],
                                 [{{:__block__, [...], ...}, {:__block__, ...}}]},
                                {:__block__,
                                 [
                                   trailing_comments: [],
                                   leading_comments: [],
                                   closing: [line: 39, ...],
                                   line: 39,
                                   ...
                                 ], [{{:__block__, ...}, {...}}]},
                                {:__block__,
                                 [
                                   trailing_comments: [],
                                   leading_comments: [],
                                   closing: [...],
                                   ...
                                 ], [{{...}, ...}]},
                                {:{},
                                 [trailing_comments: [], leading_comments: [], ...],
                                 [{...}, ...]},
                                {:__block__, [trailing_comments: [], ...], [...]},
                                {:{}, [...], ...},
                                {:__block__, ...},
                                {...},
                                ...
                              ]
                            ]}}
                        ]
                      ]},
                     {:defp,
                      [
                        trailing_comments: [],
                        leading_comments: [
                          %{
                            line: 67,
                            text: "# Aliases are shortcuts or tasks specific to the current project.",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 2
                          },
                          %{
                            line: 68,
                            text: "# For example, to install project dependencies and perform other setup tasks, run:",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 1
                          },
                          %{
                            line: 69,
                            text: "#",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 1
                          },
                          %{
                            line: 70,
                            text: "#     $ mix setup",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 1
                          },
                          %{
                            line: 71,
                            text: "#",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 1
                          },
                          %{
                            line: 72,
                            text: "# See the documentation for `Mix` for more info on aliases.",
                            column: 3,
                            next_eol_count: 1,
                            previous_eol_count: 1
                          }
                        ],
                        end_of_expression: [newlines: 1, line: 87, column: 6],
                        do: [line: 73, column: 16],
                        end: [line: 87, column: 3],
                        line: 73,
                        column: 3
                      ],
                      [
                        {:aliases,
                         [
                           trailing_comments: [],
                           leading_comments: [],
                           line: 73,
                           column: 8
                         ], nil},
                        [
                          {{:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              line: 73,
                              column: 16
                            ], [:do]},
                           {:__block__,
                            [
                              trailing_comments: [],
                              leading_comments: [],
                              end_of_expression: [newlines: 1, line: 86, column: 6],
                              newlines: 1,
                              closing: [line: 86, column: 5],
                              line: 74,
                              column: 5
                            ],
                            [
                              [
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    format: :keyword,
                                    line: 75,
                                    column: 7
                                  ], [:setup]},
                                 {:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    closing: [line: 75, ...],
                                    line: 75,
                                    ...
                                  ], [[{:__block__, ...}, {...}, ...]]}},
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    delimiter: "\"",
                                    format: :keyword,
                                    ...
                                  ], [:"ecto.setup"]},
                                 {:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    closing: [...],
                                    ...
                                  ], [[{...}, ...]]}},
                                {{:__block__,
                                  [
                                    trailing_comments: [],
                                    leading_comments: [],
                                    delimiter: "\"",
                                    ...
                                  ], [:"ecto.reset"]},
                                 {:__block__,
                                  [trailing_comments: [], leading_comments: [], ...],
                                  [[...]]}},
                                {{:__block__,
                                  [trailing_comments: [], leading_comments: [], ...],
                                  [:test]},
                                 {:__block__, [trailing_comments: [], ...], [...]}},
                                {{:__block__, [trailing_comments: [], ...], [...]},
                                 {:__block__, [...], ...}},
                                {{:__block__, [...], ...}, {:__block__, ...}},
                                {{:__block__, ...}, {...}}
                              ]
                            ]}}
                        ]
                      ]}
                   ]}}
               ]
             ]},
            opts: []
          },
          timestamp: 1744602692,
          history: [],
          issues: [],
          private: %{}
        }
      },
      extensions: %{
        ".ex" => Rewrite.Source.Ex,
        ".exs" => Rewrite.Source.Ex,
        "default" => Rewrite.Source
      },
      hooks: [Igniter.Rewrite.DotFormatterUpdater],
      dot_formatter: %Rewrite.DotFormatter{
        force_do_end_blocks: nil,
        import_deps: [:ecto, :ecto_sql, :phoenix],
        inputs: [
          %GlobEx{
            source: "priv/*/seeds.exs",
            match_dot: true,
            compiled: [{:exact, ~c"priv"}, :star, {:exact, ~c"seeds.exs"}]
          },
          %GlobEx{
            source: "{config,lib,test}/**/*.{heex,ex,exs}",
            match_dot: true,
            compiled: [
              {:alt, [[exact: ~c"config"], [exact: ~c"lib"], [exact: ~c"test"]]},
              :double_star,
              {:alt,
               [[ends_with: ~c"xeeh."], [ends_with: ~c"xe."], [ends_with: ~c"sxe."]]}
            ]
          },
          %GlobEx{
            source: "*.{heex,ex,exs}",
            match_dot: true,
            compiled: [
              alt: [
                [ends_with: ~c"xeeh."],
                [ends_with: ~c"xe."],
                [ends_with: ~c"sxe."]
              ]
            ]
          }
        ],
        locals_without_parens: [
          intercept: 1,
          connect: 3,
          connect: 4,
          delete: 3,
          delete: 4,
          forward: 2,
          forward: 3,
          forward: 4,
          get: 3,
          get: 4,
          head: 3,
          head: 4,
          match: 4,
          match: 5,
          options: 3,
          options: 4,
          patch: 3,
          patch: 4,
          pipeline: 2,
          pipe_through: 1,
          post: 3,
          post: 4,
          put: 3,
          put: 4,
          resources: 2,
          resources: 3,
          resources: 4,
          trace: 4,
          action_fallback: 1,
          plug: 1,
          plug: 2,
          socket: 2,
          socket: 3,
          channel: 2,
          channel: 3,
          assert_broadcast: 2,
          assert_broadcast: 3,
          assert_push: 2,
          assert_push: 3,
          assert_reply: 2,
          assert_reply: 3,
          assert_reply: 4,
          ...
        ],
        normalize_bitstring_modifiers: nil,
        normalize_charlists_as_sigils: nil,
        plugins: [Phoenix.LiveView.HTMLFormatter],
        sigils: [H: #Function<46.80230804/2 in Rewrite.DotFormatter.sigils/2>],
        subdirectories: ["priv/*/migrations"],
        subs: [
          %Rewrite.DotFormatter{
            force_do_end_blocks: nil,
            import_deps: [:ecto_sql],
            inputs: [
              %GlobEx{
                source: "priv/repo/migrations/*.exs",
                match_dot: true,
                compiled: [
                  exact: ~c"priv",
                  exact: ~c"repo",
                  exact: ~c"migrations",
                  ends_with: ~c"sxe."
                ]
              }
            ],
            locals_without_parens: [
              add: 2,
              add: 3,
              add_if_not_exists: 2,
              add_if_not_exists: 3,
              alter: 2,
              create: 1,
              create: 2,
              create_if_not_exists: 1,
              create_if_not_exists: 2,
              drop: 1,
              drop: 2,
              drop_if_exists: 1,
              drop_if_exists: 2,
              execute: 1,
              execute: 2,
              modify: 2,
              modify: 3,
              remove: 1,
              remove: 2,
              remove: 3,
              remove_if_exists: 1,
              remove_if_exists: 2,
              rename: 2,
              rename: 3,
              timestamps: 1
            ],
            normalize_bitstring_modifiers: nil,
            normalize_charlists_as_sigils: nil,
            plugins: [],
            sigils: nil,
            subdirectories: nil,
            subs: [],
            source: ".formatter.exs",
            plugin_opts: [],
            timestamp: 1744600013,
            path: "priv/repo/migrations"
          }
        ],
        source: ".formatter.exs",
        plugin_opts: [],
        timestamp: 1744602689,
        path: ""
      },
      excluded: []
    }

    (elixir 1.18.3) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir 1.18.3) lib/enum.ex:166: Enumerable.reduce/3
    (elixir 1.18.3) lib/stream.ex:1773: Enumerable.Stream.do_each/4
    (elixir 1.18.3) lib/stream.ex:956: Stream.do_transform/5
    (elixir 1.18.3) lib/enum.ex:4515: Enum.reduce/3
    (igniter 0.5.45) lib/igniter.ex:1439: Igniter.format/3
    (igniter 0.5.45) lib/igniter.ex:480: Igniter.update_elixir_file/3
    (igniter 0.5.45) lib/igniter/util/info.ex:292: anonymous fn/4 in Igniter.Util.Info.add_deps/3

To Reproduce

  1. mix archive.install hex phx_new 1.8.0-rc.0 --force
  2. mix phx.new my_app
  3. add igniter in mix.exs (v0.5.45)
  4. mix igniter.install ash

Expected behavior
An interactive CLI that confirms new changes in the project

** Runtime

  • Elixir version (1.18.3, asdf)
  • Erlang version (27.3.2, asdf)
  • OS (ubuntu 24.10)
  • Igniter version (0.5.45)
  • any related extension versions: using vscode

Additional context
I wanted to try the release candidate for Phoenix v1.8 with Ash using mix igniter.... No errors if using the latest stable v1.7.21

@jaeyson jaeyson added the bug Something isn't working label Apr 14, 2025
@sevenseacat
Copy link
Contributor

I just tried to replicate this and couldn't. The only difference is that I'm on Mac, not Ubuntu - can you try it again outside of a VSCode terminal?

@zachdaniel
Copy link
Contributor

Also make sure your local archive is installed, and check to be sure that you haven't accidentally installed igniter as an archive instead of igniter_new. You can see your archives with mix archive

@leandrocp
Copy link
Contributor

We had similar reports by people installing Beacon and the only "solution" for now is deleting the _build dir. I wasn't able to reproduce it either. Btw I thought we had an issue for that but I can't find it 🤔

@zachdaniel
Copy link
Contributor

So strange. I've never been able to reproduce it either 😅

@jaeyson
Copy link
Author

jaeyson commented Apr 14, 2025

Hmmm... seems weird. I switched to mac and I can't reproduce this problem. I'm not using igniter_new and no archives in the machine (clean slate). I'll remove the deps/build in ubuntu👌🏾.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants