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

Bug: Redbean demo crashes on startup on MacOS #1377

Open
sarna opened this issue Mar 2, 2025 · 1 comment
Open

Bug: Redbean demo crashes on startup on MacOS #1377

sarna opened this issue Mar 2, 2025 · 1 comment
Labels
medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)

Comments

@sarna
Copy link

sarna commented Mar 2, 2025

Contact Details

No response

What happened?

When I try running the Redbean demo it crashes immediately. I'm not sure why it takes my LUA_PATH into consideration, but it still crashes even if I set LUA_PATH to an empty string.

When I run the regular version it works fine, though.

Version

redbean 3.0.0
macOS 15.3.1 (ARM)

What operating system are you seeing the problem on?

Mac

Relevant log output

> ./redbean-demo-3.0.0.com -vvmbag
D2025-03-02T19:09:04.258731:tool/net/redbean.c:5127:redbean-demo-3:32010] (lua) LuaRunAsset("/.init.lua")
E2025-03-02T19:09:04+000293:tool/net/redbean.c:1206:redbean-demo-3:32010] (lua) failed to run lua code: /zip/.init.lua:1: module 'mymodule' not found:
        no field package.preload['mymodule']
        no file '/opt/homebrew/Cellar/luarocks/3.11.1/share/lua/5.4/mymodule.lua'
        no file '/opt/homebrew/share/lua/5.4/mymodule.lua'
        no file '/opt/homebrew/share/lua/5.4/mymodule/init.lua'
        no file '/opt/homebrew/lib/lua/5.4/mymodule.lua'
        no file '/opt/homebrew/lib/lua/5.4/mymodule/init.lua'
        no file './mymodule.lua'
        no file './mymodule/init.lua'
        no file '/Users/sarna/.luarocks/share/lua/5.4/mymodule.lua'
        no file '/Users/sarna/.luarocks/share/lua/5.4/mymodule/init.lua'
        no file '/opt/homebrew/lib/lua/5.4/mymodule.so'
        no file '/opt/homebrew/lib/lua/5.4/loadall.so'
        no file './mymodule.so'
        no file '/Users/sarna/.luarocks/lib/lua/5.4/mymodule.so'
stack traceback:
        [C]: in function 'require'
        /zip/.init.lua:1: in main chunk
@sarna sarna added the medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable) label Mar 2, 2025
@sarna
Copy link
Author

sarna commented Mar 2, 2025

I managed to fix it in a very simple way:

> echo '' >mymodule.lua
> zip redbean-demo-3.0.0.com mymodule.lua
  adding: mymodule.lua (stored 0%)
> ./redbean-demo-3.0.0.com
I2025-03-02T19:24:29.766346:tool/net/redbean.c:7052:redbean-demo-3:32319] (srvr) listen http://127.0.0.1:8080
I2025-03-02T19:24:29+000076:tool/net/redbean.c:7052:redbean-demo-3:32319] (srvr) listen http://192.168.1.4:8080
I2025-03-02T19:24:30.237122:tool/net/redbean.c:6112:redbean-demo-3:32324] (req) received 127.0.0.1:59328 HTTP11 GET http://127.0.0.1:8080/tool/net/demo/index.html "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15"
I2025-03-02T19:24:30+000166:/zip/.init.lua:76:redbean-demo-3:32324] client is running nil and reports Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15

So I'm pretty sure if mymodule = require "mymodule" was removed from .init.lua it wouldn't crash in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)
Projects
None yet
Development

No branches or pull requests

1 participant