Page 1 of 1

old error showing each time I try to run my code

Posted: Sat May 23, 2020 4:30 pm
by e2718
Hello.

TL;DR i fixed a typo in my code but when I rerun the code I get the same error as before (showing the same typo that no longer exists in the source). How do I fix this/clean my setup?

Background:
I just started using Love today after watching some tutorials and reading some articles in the wiki.

I am on Mac OS and have Love in my /Applications folder and the alias in my .bash_profile as per the https://love2d.org/wiki/Getting_Started instructions.

I got the Hello World code working so I branched out into drawing a rectangle but unfortunately typoed "love" as "loves". When I ran the code using

Code: Select all

open -n -a love src/
I got the following error:

Code: Select all

main.lua:2: attempt to index global 'loves' (a nil value)
I then changed "loves" to "love" so my code is now as follows

Code: Select all

function love.draw()
    love.graphics.rectangle("fill", 20, 50, 60, 120 )
end
but I still get the same error about "loves". This happens no matter what I put in love.draw.

How do I fix this?

Re: old error showing each time I try to run my code

Posted: Sat May 23, 2020 6:15 pm
by zorg
Hi and welcome to the forums!

I know it's a silly question, but are you absolutely sure you saved the file?

Re: old error showing each time I try to run my code

Posted: Sat Aug 08, 2020 11:47 am
by hammers
e2718 wrote: Sat May 23, 2020 4:30 pm Hello.

TL;DR i fixed a typo in my code but when I rerun the code I get the same error as before (showing the same typo that no longer exists in the source). How do I fix this/clean my setup?

Background:
I just started using Love today after watching some tutorials and reading some articles in the wiki.

I am on Mac OS and have Love in my /Applications folder and the alias in my .bash_profile as per the https://love2d.org/wiki/Getting_Started instructions.

I got the Hello World code working so I branched out into drawing a rectangle but unfortunately typoed "love" as "loves". When I ran the code using

Code: Select all

open -n -a love src/
I got the following error:

Code: Select all

main.lua:2: attempt to index global 'loves' (a nil value)
I then changed "loves" to "love" so my code is now as follows

Code: Select all

function love.draw()
    love.graphics.rectangle("fill", 20, 50, 60, 120 )
end
but I still get the same error about "loves". This happens no matter what I put in love.draw.

How do I fix this?
I'm facing the exact same problem here. SO, anyone. Suggestions?