lune icon indicating copy to clipboard operation
lune copied to clipboard

lune build - require throws an error for standalone binaries

Open TokenManiac opened this issue 5 months ago • 2 comments

v0.10.1

lune run main.luau works normally but running the standalone binary with require does not work.

> Make the file "main.luau" with the content require("./anotherluaumodule") > Build the file lune build main.luau > Execute the binary

Image

Apparently lune std library "@lune/..." does work.

This used to work in previous versions of lune what do I need to do?

TokenManiac avatar Jul 23 '25 17:07 TokenManiac

The lune build command currently doesn't package other required modules. If you want other modules in your built executable, use a luau packager like darklua.

amol234545 avatar Jul 29 '25 00:07 amol234545

Looks like a regression from migrating to "proper" Luau require-by-string mechanisms. The runner for standalone / built executables runs with a custom chunk name instead of a file path, and require-by-string now always needs some kind of file path to work. We can probably set it to the current working directory and have this work again 🤔

filiptibell avatar Jul 29 '25 09:07 filiptibell