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

attempt to call global 'require' (a nil value) #51

Closed
egordorichev opened this issue Sep 30, 2017 · 4 comments
Closed

attempt to call global 'require' (a nil value) #51

egordorichev opened this issue Sep 30, 2017 · 4 comments

Comments

@egordorichev
Copy link

> love-release
/usr/bin/lua5.1: /usr/local/share/lua/5.1/love-release/pipes/conf.lua:23: conf.lua:3: attempt to call global 'require' (a nil value)
stack traceback:
	[C]: in function 'assert'
	/usr/local/share/lua/5.1/love-release/pipes/conf.lua:23: in function </usr/local/share/lua/5.1/love-release/pipes/conf.lua:14>
	(tail call): ?
	...luarocks/rocks/love-release/2.0.4-1/bin/love-release:11: in main chunk
	[C]: ?
@pablomayobre
Copy link
Contributor

This project uses loadconf to execute the conf.lua file in a safe environment, require is not included in this sandbox.

This is related to issue #27 and #49.

If you want to provide a conf.lua that works both in LÖVE and love-release, make sure you first check if you are running on LÖVE with something similar to:

if love.filesystem then
  --This is LÖVE
end

@egordorichev
Copy link
Author

I don't have a config for love-release. Here is my conf.lua: https://github.com/egordorichev/neko8/blob/master/conf.lua

It was running ok, but something happened and it broke. Debian package building was broken all time.

@pablomayobre
Copy link
Contributor

pablomayobre commented Oct 1, 2017

love-release tries to load conf.lua even if you don't have specific configurations for love-release

Try to do something like

if not require then --Detect that this isn't LÖVE but love-release
  love.conf = function () end
else
  --Your code goes here
end

@egordorichev
Copy link
Author

Oh, that works. Thank you :)

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