Skip to content
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

misleading error message with multiple "use Ash.Domain" macro invocations. #1537

Open
at7heb opened this issue Oct 20, 2024 · 0 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@at7heb
Copy link

at7heb commented Oct 20, 2024

Describe the bug
I had two use Ash.Domain macro calls in my domain definition file. The error message

    error: def can?/3 defines defaults multiple times. Elixir allows defaults to be declared once per definition. Instead of:

misled me, and the indicated line was the defmodule line:

    │
  1 │ defmodule Ogl.Example do
    │ ^^^^^^^^^^^^^^^^^^^^^^^^
    │
    └─ lib/ogl/example.ex:1

To Reproduce

Ogl.Example do
  use Ash.Domain

  # In your Domain(s)
  use Ash.Domain,
    extensions: [AshAdmin.Domain]
end

Expected behavior
The error message should have indicated that the second use Ash.Domain line was the problem.
Runtime

 Erlang/OTP 27 [erts-15.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace]

IEx 1.17.3 (compiled with Erlang/OTP 27)
  • macOS Sonoma 14.6.1
  • Ash "ash": {:hex, :ash, "3.4.11", "f96d33a2f63773262dec7dae6b7af3fa998b8fd1f1ac22dbed8e49475c92fbb3", ...

Additional context
Low priority -- I won't do this again.

@at7heb at7heb added bug Something isn't working needs review labels Oct 20, 2024
@zachdaniel zachdaniel moved this to Someday in Ash Framework Roadmap Oct 20, 2024
@zachdaniel zachdaniel added the good first issue Good for newcomers label Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: Someday
Development

No branches or pull requests

2 participants