Warning: function Magnify.User.changeset/2 is undefined

I installed Coherence and when I run my server I’m getting the following warning message

warning: function Magnify.User.__struct__/0 is undefined (module Magnify.User is not available)
Found at 2 locations:
  lib/magnify/coherence/schemas.ex:35
  lib/magnify/coherence/schemas.ex:39

warning: function Magnify.User.changeset/2 is undefined (module Magnify.User is not available)
Found at 3 locations:
  lib/magnify/coherence/schemas.ex:31
  lib/magnify/coherence/schemas.ex:35
  lib/magnify/coherence/schemas.ex:39

I’m not sure why schemas is generated by coherence and here is the code

def change_user(struct, params) do
    @user_schema.changeset struct, params
  end

  def change_user(params) do
    @user_schema.changeset @user_schema.__struct__, params
  end

  def change_user do
    @user_schema.changeset @user_schema.__struct__, %{}
  end

So is this error correct? Do you have a Magnify.User module defined somewhere?

I understood that Coherence does the following (from the docs) “add a new User model if one does not already exist”

I didn’t install or add anything

I do have the following

27%20AM

i.e.

defmodule Magnify.Coherence.User do
  @moduledoc false
  use Ecto.Schema
  use Coherence.Schema

For some reason it expects Magnify.User instead of your Magnify.Coherence.User. Maybe try replacing Magnify.Coherence.User with Magnify.User and see if that would make it work. Or search for Magnify.User in your project and see if there is some config typo.

Yes I found this in a config

config :coherence,
  user_schema: Magnify.User,
  repo: Magnify.Repo,
  module: Magnify,
  web_module: Magnify.Web,
  router: Magnify.Router,
  messages_backend: Magnify.Coherence.Messages,
  logged_out_url: "/",
  email_from_name: "Your Name",
  email_from_email: "yourname@example.com",
  opts: [:authenticatable, :recoverable, :lockable, :trackable, :unlockable_with_token, :invitable, :registerable]

I updated the following user_schema: Magnify.User, to user_schema: Magnify.Coherence.User,

and it looks like it’s working, at least this issue is solved, have different issues. Not sure Coherence is a good package with all these issues

Not sure Coherence is a good package with all these issues

If you think you are running into issues with coherence itself, not your use of it, you might want to open some issues on github.

Yea already did that https://github.com/smpallen99/coherence/issues/341