Skip to content

Types of property 'Api' are incompatible #2

@JadedBlueEyes

Description

@JadedBlueEyes
src/cloud.ts:15:1 - error TS2322: Type '{ Api: typeof Api; getWorlds: () => Promise<WorldInfo[]>; fetch: any; }' is not assignable to type '{ Api: new (info: WorldInfo) => WorldApi; getWorlds: () => Promise<WorldInfo[]>; fetch: (input?: ...'.
  Types of property 'Api' are incompatible.
    Type 'typeof Api' is not assignable to type 'new (info: WorldInfo) => WorldApi'.
      Type 'Api' is not assignable to type 'WorldApi'.
        Property 'name' is missing in type 'Api'.

15 MessageBot.dependencies = { Api, getWorlds, fetch }
   ~~~~~~~~~~~~~~~~~~~~~~~


src/mac.ts:14:1 - error TS2322: Type '{ Api: typeof Api; getWorlds: () => Promise<WorldInfo[]>; fetch: any; }' is not assignable to type '{ Api: new (info: WorldInfo) => WorldApi; getWorlds: () => Promise<WorldInfo[]>; fetch: (input?: ...'.
  Types of property 'Api' are incompatible.
    Type 'typeof Api' is not assignable to type 'new (info: WorldInfo) => WorldApi'.
      Type 'Api' is not assignable to type 'WorldApi'.
        Property 'name' is missing in type 'Api'.

14 MessageBot.dependencies = { Api, getWorlds, fetch }
   ~~~~~~~~~~~~~~~~~~~~~~~

steps to reproduce:

  1. start up fresh windows machine with npm and no yarn.
  2. go into new directory
  3. run git clone https://github.com/Blockheads-Messagebot/Console-Loader.git
  4. cd Console-Loader
  5. npm install
  6. npm run build

And voila, typescript hates on your code. 😉

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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