ecsx-framework / ECSx

An Entity-Component-System framework for Elixir
GNU General Public License v3.0
210 stars 10 forks source link

Unable to restart application after renaming component names and/or value types #71

Closed bumbus closed 11 months ago

bumbus commented 11 months ago

After some manual edits to some components my app fails on start up with:

[error] GenServer #PID<0.728.0> terminating
** (ArgumentError) errors were found at the given arguments:

  * 1st argument: the table identifier does not refer to an existing ETS table

    (stdlib 4.2) :ets.match_object(Cid.Components.PlayerSpawned, :_)
    (stdlib 4.2) ets.erl:771: :ets.tab2list/1
    (ecsx 0.5.0) lib/ecsx/base.ex:96: ECSx.Base.get_all_keys/1
    (cid 0.1.1) lib/cid_web/channels/game_channel.ex:37: CidWeb.GameChannel.handle_info/2
    (phoenix 1.7.10) lib/phoenix/channel/server.ex:358: Phoenix.Channel.Server.handle_info/2
    (stdlib 4.2) gen_server.erl:1123: :gen_server.try_dispatch/4
    (stdlib 4.2) gen_server.erl:1200: :gen_server.handle_msg/6
    (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

I already tried to fix it be deleting the persistance file and _build folder, with no luck. I wonder how to recover from this state?

APB9785 commented 11 months ago

Hi @bumbus, thanks for using ECSx! When you renamed the components, did you update the names in manager.ex? It sounds like the manager still has the old name, while the component module has a new name. But I can't say for sure just from that error message. If you can share your repo, I'd be happy to investigate further!