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

Error while checking types, asked to report this bug #14015

Open
instancer-kirik opened this issue Nov 25, 2024 · 3 comments
Open

Error while checking types, asked to report this bug #14015

instancer-kirik opened this issue Nov 25, 2024 · 3 comments

Comments

@instancer-kirik
Copy link

Elixir and Erlang/OTP versions

Setting up umbrella app, accounts and setting namespaces

** (EXIT from #PID<0.95.0>) an exception was raised:
    ** (RuntimeError) found error while checking types for ResolvinatorWeb.UserRegistrationLive.mount/3:

** (UndefinedFunctionError) function Veix.Accounts.User.__info__/1 is undefined (module Veix.Accounts.User is not available)
The exception happened while checking this code:

def mount(_params, _session, socket) do
  changeset =
    Veix.Accounts.Registration.change_user_registration(%Veix.Accounts.User{
      __meta__: %{
        __struct__: Ecto.Schema.Metadata,
        context: nil,
        prefix: nil,
        schema: Veix.Accounts.User,
        source: "users",
        state: :built
      },
      confirmed_at: nil,
      deepscape_profile: %{
        __cardinality__: :one,
        __field__: :deepscape_profile,
        __owner__: Veix.Accounts.User,
        __struct__: Ecto.Association.NotLoaded
      },
      email: nil,
      first_name: nil,
      id: nil,
      inserted_at: nil,
      last_name: nil,
      live_beats_profile: %{
        __cardinality__: :one,
        __field__: :live_beats_profile,
        __owner__: Veix.Accounts.User,
        __struct__: Ecto.Association.NotLoaded
      },
      password: nil,
      password_confirmation: nil,
      password_hash: nil,
      pause_effect_profile: %{
        __cardinality__: :one,
        __field__: :pause_effect_profile,
        __owner__: Veix.Accounts.User,
        __struct__: Ecto.Association.NotLoaded
      },
      resolvinator_profile: %{
        __cardinality__: :one,
        __field__: :resolvinator_profile,
        __owner__: Veix.Accounts.User,
        __struct__: Ecto.Association.NotLoaded
      },
      role: "user",
      settings: %{},
      timetracker_profile: %{
        __cardinality__: :one,
        __field__: :timetracker_profile,
        __owner__: Veix.Accounts.User,
        __struct__: Ecto.Association.NotLoaded
      },
      tokens: %{
        __cardinality__: :many,
        __field__: :tokens,
        __owner__: Veix.Accounts.User,
        __struct__: Ecto.Association.NotLoaded
      },
      typer_profile: %{
        __cardinality__: :one,
        __field__: :typer_profile,
        __owner__: Veix.Accounts.User,
        __struct__: Ecto.Association.NotLoaded
      },
      updated_at: nil
    })

  socket =
    assign_form(
      Phoenix.Component.assign(socket, trigger_submit: false, check_errors: false),
      changeset
    )

  {:ok, socket, temporary_assigns: [form: nil]}
end

Please report this bug at: https://github.com/elixir-lang/elixir/issues

        (accounts 0.1.0) Veix.Accounts.User.__info__(:struct)
        (elixir 1.17.2) lib/module/types/of.ex:182: Module.Types.Of.struct/6
        (elixir 1.17.2) lib/module/types/helpers.ex:128: Module.Types.Helpers.do_map_reduce_ok/3
        (elixir 1.17.2) lib/module/types/expr.ex:332: Module.Types.Expr.of_expr/3
        (elixir 1.17.2) lib/module/types/expr.ex:125: Module.Types.Expr.of_expr/3
        (elixir 1.17.2) lib/module/types/helpers.ex:128: Module.Types.Helpers.do_map_reduce_ok/3
        (elixir 1.17.2) lib/module/types/expr.ex:185: Module.Types.Expr.of_expr/3
        (elixir 1.17.2) lib/module/types.ex:56: Module.Types.warnings_from_clause/6

Operating system

6.10.13-3-MANJARO

Current behavior

configuring the accounts registration; just saw this in one of the steps

Expected behavior

warn or coerce correct namespacing? App.Accounts or ..

@josevalim
Copy link
Member

Thank you. I assume the struct does exist, no? Is this happening in dev or tests? Can you provide a way to reproduce it?

@instancer-kirik
Copy link
Author

during dev. It's not occurring now, the struct and references are now fully for Accounts.User, Accounts.Auth..

@josevalim
Copy link
Member

Can you still reproduce it by doing changes to the code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants