At7heb
My mistake: I had two “use Ash.Domain” lines in my file – the second one to add “AshAdmin.Domain”.
The error message was misleading to me. The message indicated the problem was with the “defmodule” line.
My wish: the error message was more along the lines of “don’t repeat ‘use Ash.Domain’ in the same file”
Suggestion: the error message should indicate the problem is in the second “use Ash.Domain” line instead of the “defmodule …” line.
Here’s the error I got
heb@howards-mbp ogl % mix compile
Compiling 3 files (.ex)
error: def can?/3 defines defaults multiple times. Elixir allows defaults to be declared once per definition. Instead of:
def foo(:first_clause, b \\ :default) do ... end
def foo(:second_clause, b \\ :default) do ... end
one should write:
def foo(a, b \\ :default)
def foo(:first_clause, b) do ... end
def foo(:second_clause, b) do ... end
│
1 │ defmodule Ogl.Lesson do
│ ^^^^^^^^^^^^^^^^^^^^^^^
│
└─ lib/ogl/lesson.ex:1
== Compilation error in file lib/ogl/lesson.ex ==
** (CompileError) lib/ogl/lesson.ex: cannot compile file (errors have been logged)
/Users/heb/dev/ogl/lib/ogl/lesson.ex:1: (file)
(stdlib 6.1) erl_eval.erl:904: :erl_eval.do_apply/7
(stdlib 6.1) erl_eval.erl:271: :erl_eval.exprs/6
(stdlib 6.1) erl_eval.erl:436: :erl_eval.expr/6
(spark 2.2.27) /Users/heb/dev/ogl/lib/ogl/lesson.ex:1: Spark.Dsl.__before_compile__/1
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
Yeah, this is pretty interesting. I imagine that pretty much any module that defines a
since it’s a code mix in like that. It wouldn’t be a high priority, but would be relatively easy to detect so makes sense to add. Could you open an issue on the ash repo?
uselike this does not anticipate being used twiceAt7heb
Done.
I don’t have a good sense of when I can and when I can’t repeat a macro call. E.G. in router.ex, multiple
scope "/" dolines are acceptable.At7heb
I would hate to start a bunch of stuff like the C header stuff
zachdaniel
99.9% of the time, a
usemacro is meant to be performed only once.At7heb
I should have figured that out.
Quoting Peter, Paul, and Mary, “I’ll learn so that my later days will be prosperous…”