Troubleshooting
Tried to fetch a resource, but the resource does not exist.
This is the most common issue you will face as a new user of Specs.
This panic will occur whenever a System
is first dispatched, and one or
more of the components and/or resources it uses is missing from World
.
There are a few main reasons for this occurring:
- Forgetting to call
setup
after building aDispatcher
orParSeq
. Make sure this is always run before the first dispatch. - Not adding mandatory resources to
World
. You can usually find these by searching for occurrences ofReadExpect
andWriteExpect
. - Manually requesting components/resources from
World
(not inside aSystem
), where the component/resource is not used by anySystem
s, which is most common when using theEntityBuilder
. This is an artifact of howsetup
works, it will only add what is found inside the usedSystem
s. If you use other components/resources, you need to manually register/add these toWorld
.