Skip to content

npx tsc error TS2345 #120

Closed
Closed
@Vance0124

Description

When I run the command:

npx tsc

It runs wrong with the errors:

src/BlockVeins.ts:25:32 - error TS2345: Argument of type 'import("E:/PythonProject/server/Voyager/voyager/env/mineflayer/node_modules/mineflayer/node_modules/prismarine-block/index").Block' is not assignable to parameter of type 'import("E:/PythonProject/server/Voyager/voyager/env/mineflayer/node_modules/prismarine-block/index").Block'.
  The types returned by 'getProperties()' are incompatible between these types.
    Type '{ [key: string]: string | number | boolean; }' is not assignable to type '{ [key: string]: string | number; }'.
      'string' index signatures are incompatible.
        Type 'string | number | boolean' is not assignable to type 'string | number'.
          Type 'boolean' is not assignable to type 'string | number'.

25           if (targets.includes(neighbor)) continue
                                  ~~~~~~~~

src/BlockVeins.ts:26:29 - error TS2345: Argument of type 'import("E:/PythonProject/server/Voyager/voyager/env/mineflayer/node_modules/mineflayer/node_modules/prismarine-block/index").Block' is not assignable to parameter of type 'import("E:/PythonProject/server/Voyager/voyager/env/mineflayer/node_modules/prismarine-block/index").Block'.

26           if (open.includes(neighbor)) continue
                               ~~~~~~~~

src/BlockVeins.ts:28:21 - error TS2345: Argument of type 'import("E:/PythonProject/server/Voyager/voyager/env/mineflayer/node_modules/mineflayer/node_modules/prismarine-block/index").Block' is not assignable to parameter of type 'import("E:/PythonProject/server/Voyager/voyager/env/mineflayer/node_modules/prismarine-block/index").Block'.

28           open.push(neighbor)
                       ~~~~~~~~

src/CollectBlock.ts:209:23 - error TS2345: Argument of type 'import("E:/PythonProject/server/Voyager/voyager/env/mineflayer/node_modules/prismarine-block/index").Block' is not assignable to parameter of type 'import("E:/PythonProject/server/Voyager/voyager/env/mineflayer/node_modules/mineflayer/node_modules/prismarine-block/index").Block'.
  Type 'Block' is missing the following properties from type 'Block': setSignText, getSignText

209         await bot.dig(block);
                          ~~~~~


Found 4 errors in 2 files.

Errors  Files
     3  src/BlockVeins.ts:25
     1  src/CollectBlock.ts:209

How can I fix it? Please tell me, thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions