Skip to content

Argument of type '{ icon: DivIcon; }' is not assignable to parameter of type 'MarkerOptions | undefined'. #40

@cornelius-agrippa

Description

@cornelius-agrippa

Hello,

I was trying to run this project for the first time but I'm having some trouble with it.

I did the usual npm install and then npm run dev to get it running, however I get the following errors:

ERROR in [at-loader] src\ui\map\SensorMap.tsx:78:87
    TS2345: Argument of type '{ icon: DivIcon; }' is not assignable to parameter of type 'MarkerOptions | undefined'.
  Type '{ icon: DivIcon; }' is not assignable to type 'MarkerOptions'.
    Types of property 'icon' are incompatible.
      Type 'DivIcon' is not assignable to type 'Icon | undefined'.
        Type 'DivIcon' is not assignable to type 'Icon'.
          Types of property 'options' are incompatible.
            Type 'DivIconOptions' is not assignable to type 'IconOptions'.
              Types of property 'iconUrl' are incompatible.
                Type 'string | undefined' is not assignable to type 'string'.
                  Type 'undefined' is not assignable to type 'string'.

ERROR in [at-loader] src\ui\map\SensorMap.tsx:112:55
    TS2345: Argument of type '{ icon: DivIcon; }' is not assignable to parameter of type 'MarkerOptions | undefined'.
  Type '{ icon: DivIcon; }' is not assignable to type 'MarkerOptions'.
    Types of property 'icon' are incompatible.
      Type 'DivIcon' is not assignable to type 'Icon | undefined'.
        Type 'DivIcon' is not assignable to type 'Icon'.

ERROR in [at-loader] src\ui\map\SensorMap.tsx:115:9
    TS2532: Object is possibly 'undefined'.

ERROR in [at-loader] src\ui\map\SensorMap.tsx:126:15
    TS2532: Object is possibly 'undefined'.
webpack: Failed to compile.

I have a feeling something's wrong with the leaflet package, but I could be wrong.

Do you have any idea what could be wrong?

Node version is 7.5.0
NPM version is 4.1.2

My best regards

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