Skip to content

Upgrade deps and fix compiler error#241

Open
xMdb wants to merge 2 commits intoMiscGuild:masterfrom
xMdb:upgrade-deps
Open

Upgrade deps and fix compiler error#241
xMdb wants to merge 2 commits intoMiscGuild:masterfrom
xMdb:upgrade-deps

Conversation

@xMdb
Copy link
Copy Markdown
Contributor

@xMdb xMdb commented Apr 25, 2026

@jejebecarte pls test and review
i was running into this compiler error complaining about Bot type even on the latest branch. not sure why, my current build was working successfully (built sept last year)

src/mineflayer/mineflayer.ts:98:63 - error TS2345: Argument of type 'Bot' is not assignable to parameter of type 'EventEmitter<any>'.
  The types returned by 'listeners(...)' are incompatible between these types.
    Type 'Function[]' is not assignable to type '((...args: any[]) => void)[]'.
      Type 'Function' is not assignable to type '(...args: any[]) => void'.
        Type 'Function' provides no match for the signature '(...args: any[]): void'.

98         await loadEvents(path.join(__dirname, 'events/chat'), this.bot, bridge);
                                                                 ~~~~~~~~

src/mineflayer/mineflayer.ts:99:66 - error TS2345: Argument of type 'Bot' is not assignable to parameter of type 'EventEmitter<any>'.
  The types returned by 'listeners(...)' are incompatible between these types.
    Type 'Function[]' is not assignable to type '((...args: any[]) => void)[]'.
      Type 'Function' is not assignable to type '(...args: any[]) => void'.
        Type 'Function' provides no match for the signature '(...args: any[]): void'.

99         await loadEvents(path.join(__dirname, 'events/handler'), this.bot, bridge);
                                                                    ~~~~~~~~

src/util/load-events.ts:29:14 - error TS2352: Conversion of type 'EventEmitter<any>' to type 'Bot' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Type 'EventEmitter<any>' is missing the following properties from type 'Bot': username, protocolVersion, majorVersion, version, and 125 more.

29             (emitter as Bot).addChatPattern(name.replace('chat:', ''), regex[name], {
                ~~~~~~~~~~~~~~


Found 3 errors in 2 files.

Errors  Files
     2  src/mineflayer/mineflayer.ts:98
     1  src/util/load-events.ts:29
 ELIFECYCLE  Command failed with exit code 2.

so i fixed it

@jejebecarte
Copy link
Copy Markdown
Member

👍 I'll take a look soon™

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

Successfully merging this pull request may close these issues.

2 participants