Skip to content

Conversation

@kaylenmistry
Copy link
Contributor

@kaylenmistry kaylenmistry commented Jun 23, 2025

Started getting the following error when upgrading to Ecto 3.13.1:

warning: undefined module attribute @timestamps_opts, please remove access to @timestamps_opts or explicitly set it before access
  lib/app/accounts/user.ex:22: App.Accounts.User (module)


== Compilation error in file lib/app/accounts/user.ex ==
** (FunctionClauseError) no function clause matching in Keyword.merge/2    
    
    The following arguments were given to Keyword.merge/2:
    
        # 1
        nil
    
        # 2
        []
    
    Attempted function clauses (showing 3 out of 3):
    
        def merge(keywords1, []) when is_list(keywords1)
        def merge([], keywords2) when is_list(keywords2)
        def merge(keywords1, keywords2) when is_list(keywords1) and is_list(keywords2)
    
    (elixir 1.15.2) lib/keyword.ex:9[79]
    lib/app/accounts/user.ex:22: (module)

=> finished in 0:02

 ✕ compiler error code 1 in 0:02

@oliver-kriska
Copy link

there is already PR to fix it #47
Also you code:

Module.get_attribute(__MODULE__, :timestamps_opts) || []

can be written correctly with 3rd param in function for default value :)

Module.get_attribute(__MODULE__, :timestamps_opts, [])

@bamorim
Copy link
Owner

bamorim commented Jun 24, 2025

Closing as a duplicate of #47. But thanks @kaylenmistry for reaching out to me in private xD

@bamorim bamorim closed this Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants