old error showing each time I try to run my code

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
e2718
Prole
Posts: 1
Joined: Sat May 23, 2020 4:18 pm

old error showing each time I try to run my code

Post 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?
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post by zorg »

Hi and welcome to the forums!

I know it's a silly question, but are you absolutely sure you saved the file?
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
hammers
Prole
Posts: 1
Joined: Thu Jun 25, 2020 8:14 am

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

Post 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?
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests