bad argument #1 to '?' in function 'require' ERROR
Posted: Wed Oct 24, 2018 3:37 pm
Hi guys.
First off, some details:
OS: Mac Sierra
LOVE2D version: 11.1
The console outputs the following error to the screen:
It seems that this is outputted in a random fashion. I have other versions of the code (that do not change significantly) in the same directory and with the same push.lua latest versions, yet these other versions work too. I also tried to make another test from scratch and when I try to require 'push', I get the same error.
And yes, push.lua is in the same directory as main.lua
Here is a snippet of the code:
I suspect it's something dumb, but why would other versions with this exact same code work? they only differ in a change in some irrelevant functions or external classes.
First off, some details:
OS: Mac Sierra
LOVE2D version: 11.1
The console outputs the following error to the screen:
Code: Select all
Error
bad argument #1 to '?' (string expected, got nil)
Traceback
[C]: at 0x010f045a10
[C]: in function 'require'
main.lua:22: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
And yes, push.lua is in the same directory as main.lua
Here is a snippet of the code:
Code: Select all
push = require 'push'
-- classic OOP class library
Class = require 'class'
-- bird class we've written
require 'Bird'