[SOLVED] setRequirePath() appears to not be doing anything

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
User avatar
NetherGranite
Prole
Posts: 30
Joined: Wed Jul 11, 2018 11:08 pm

[SOLVED] setRequirePath() appears to not be doing anything

Post by NetherGranite »

If I say love.filesystem.setRequirePath("./libraries/?.lua") and then call require("library"), for example, I get the following error:

Code: Select all

Error

main.lua:24: module 'library' not found:
no field package.preload['library']
no 'library' in LOVE game directories.
no file 'library' in LOVE paths.
no file '.\library.lua'
no file 'C:\Program Files (x86)\LOVE\lua\library.lua'
no file 'C:\Program Files (x86)\LOVE\lua\library\init.lua'
no file '.\library.dll'
no file 'C:\Program Files (x86)\LOVE\library.dll'
no file 'C:\Program Files (x86)\LOVE\loadall.dll'


Traceback

[C]: in function 'require'
main.lua:24: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
It appears that Lua didn't even try any of love2d's paths. How can I fix this?
Last edited by NetherGranite on Tue Oct 09, 2018 9:22 am, edited 1 time in total.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: setRequirePath() appears to not be doing anything

Post by pgimeno »

It did, it's just not explicit about it:

"no file 'library' in LOVE paths."

Works for me if I omit './', fails if I include it.
User avatar
NetherGranite
Prole
Posts: 30
Joined: Wed Jul 11, 2018 11:08 pm

Re: setRequirePath() appears to not be doing anything

Post by NetherGranite »

pgimeno wrote: Tue Oct 09, 2018 9:16 am It did, it's just not explicit about it:

"no file 'library' in LOVE paths."

Works for me if I omit './', fails if I include it.
Thanks, that was the solution.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 46 guests