Skip to content

attempt to index a nil value (global 'bit') #7

Description

@greatvovan

Чистый Lua 5.4, не удаётся импортировать цепочку зависимостей:

lua: ./gmod/deps/hash.lua:11: attempt to index a nil value (global 'bit')
stack traceback:
	./gmod/deps/hash.lua:11: in main chunk
	[C]: in function 'require'
	./gmod/util.lua:60: in main chunk
	[C]: in function 'require'
	./ggram/request.lua:6: in main chunk
	[C]: in function 'require'
	./ggram/bot.lua:44: in main chunk
	[C]: in function 'require'
	./ggram.lua:26: in function 'ggram.bot'
	(...tail calls...)
	test.lua:2: in main chunk
	[C]: in ?

Где test.lua:

local ggram = require("ggram")
local bot = ggram("...")

require("ggram.polling").start(bot) -- enables getUpdates loop

bot.command("start", function(ctx)
	ctx.reply.text("Hello @" .. ctx.from.username)
end)

Смотря на https://github.com/TRIGONIM/lua-gmod-lib/blob/main/lua/gmod/deps/hash.lua#L11, не уверен, что понимаю, как это должно работать. Что это за bit.bor, bit.band и т.д.? Извините, я не спец в Lua, но

% lua
Lua 5.4.8  Copyright (C) 1994-2025 Lua.org, PUC-Rio
> bit
nil
> bit.bor
stdin:1: attempt to index a nil value (global 'bit')
stack traceback:
	stdin:1: in main chunk
	[C]: in ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions