diff --git a/CLI/src/Repl.cpp b/CLI/src/Repl.cpp index 56d9cf8b..9fb1221f 100644 --- a/CLI/src/Repl.cpp +++ b/CLI/src/Repl.cpp @@ -581,7 +581,14 @@ static bool runFile(const char* name, lua_State* GL, bool repl) // new thread needs to have the globals sandboxed luaL_sandboxthread(L); - std::string chunkname = "@" + std::string(name); + // ignore file extension when storing module's chunkname + std::string chunkname = "@"; + std::string_view nameView = name; + if (size_t dotPos = nameView.find_last_of('.'); dotPos != std::string_view::npos) + { + nameView.remove_suffix(nameView.size() - dotPos); + } + chunkname += nameView; std::string bytecode = Luau::compile(*source, copts()); int status = 0;