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 when initializing lovetoys #63

Closed
Substr opened this issue Dec 26, 2016 · 2 comments
Closed

Error when initializing lovetoys #63

Substr opened this issue Dec 26, 2016 · 2 comments

Comments

@Substr
Copy link

Substr commented Dec 26, 2016

Hi, I'm getting the following error when initializing lovetoys. Using the latest .zip download, running with the latest love2d version.

Error:
Error: lib/lovetoys/src/events/ComponentAdded.lua:12: attempt to call field 'class' (a nil value)

minimal main.lua:

lovetoys = require('lib.lovetoys.lovetoys')
lovetoys.initialize({
    globals = true,
    debug = true
})

Did a bit of debugging, breaking on this line:

ComponentAdded.lua:12
local ComponentAdded = require(folderOfThisFile .. '.namespace').class("ComponentAdded")

It seems like it's trying to include the empty table from namespace.lua which was previously populated with various things (including 'class') in lovetoys.lua populateNamespace()

however it doesn't seem like it's actually referring to the same table:

>>> require(folderOfThisFile .. '.namespace')
{} --[[table: 0x0b3834c8]]

>>> lovetoys  -- This is supposed to be the same table as the one included from namespace.lua
{class = {Object = "class Object", _DESCRIPTION = "Object --  (TRIMMED) [[..skipped..]] end}} --
[[table: 0x08c47738]]
@Substr
Copy link
Author

Substr commented Dec 27, 2016

I seem to have found the problem, but not the reason for it:

lovetoys = require("lib.lovetoys.lovetoys") // This causes the error mentioned above
lovetoys = require("lib/lovetoys/lovetoys") // This works

Hopefully this helps you resolve the bug.

@raffomania
Copy link
Member

Fixed on master. We will issue a bugfix release soon. Thanks for reporting!

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

No branches or pull requests

2 participants