alexandrainst / alexandra-trackmap-panel

Grafana map plugin to visualise coordinates as markers, hexbin, ant path, or heatmap.
MIT License
77 stars 26 forks source link

2.2.0 build fails, 2.1.0 works #48

Closed whileoneloop closed 3 years ago

whileoneloop commented 3 years ago

Getting an error during build of 2.2.0.

Commands used:

yarn
yarn build

Tried with node@12, node@14, node@15, getting the same error for latest master (2.2.0). The workaround for now is to build 2.1.0 instead.

 ERROR in /home/tim/alexandra-trackmap-panel/src/TrackMapPanel.tsx
  ERROR in /home/tim/alexandra-trackmap-panel/src/TrackMapPanel.tsx(172,64):
  TS2769: No overload matches this call.
    Overload 1 of 2, '(props: Readonly<MarkerProps>): Marker<MarkerProps, Marker<any>>', gave the following error.
      Type 'Icon<IconOptions>' is not assignable to type 'Icon<IconOptions> | DivIcon | undefined'.
        Type 'Icon<IconOptions>' is not assignable to type 'DivIcon'.
          Types of property 'addTo' are incompatible.
            Type '(map: Map | LayerGroup<any>) => Icon<IconOptions>' is not assignable to type '(map: Map | LayerGroup<any>) => DivIcon'.
              Types of parameters 'map' and 'map' are incompatible.
                Type 'L.Map | L.LayerGroup<any>' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map | import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").LayerGroup<any>'.
                  Type 'Map' is not assignable to type 'Map | LayerGroup<any>'.
                    Type 'L.Map' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map'.
                      Types of property 'getRenderer' are incompatible.
                        Type '(layer: L.Path) => L.Renderer' is not assignable to type '(layer: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer'.
                          Types of parameters 'layer' and 'layer' are incompatible.
                            Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path' is not assignable to type 'L.Path'.
                              Types of property 'setStyle' are incompatible.
                                Type '(style: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").PathOptions) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path' is not assignable to type '(style: L.PathOptions) => L.Path'.
                                  Types of parameters 'style' and 'style' are incompatible.
                                    Type 'L.PathOptions' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").PathOptions'.
                                      Types of property 'renderer' are incompatible.
                                        Type 'L.Renderer | undefined' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer | undefined'.
                                          Type 'L.Renderer' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer'.
                                            Types of property 'addTo' are incompatible.
                                              Type '(map: L.Map | L.LayerGroup<any>) => L.Renderer' is not assignable to type '(map: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map | import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").LayerGroup<any>) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer'.
                                                Types of parameters 'map' and 'map' are incompatible.
                                                  Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map | import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").LayerGroup<any>' is not assignable to type 'L.Map | L.LayerGroup<any>'.
                                                    Type 'Map' is not assignable to type 'Map | LayerGroup<any>'.
                                                      Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map' is not assignable to type 'L.Map'.
                                                        Types of property 'getRenderer' are incompatible.
                                                          Type '(layer: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer' is not assignable to type '(layer: L.Path) => L.Renderer'.
                                                            Types of parameters 'layer' and 'layer' are incompatible.
                                                              Type 'L.Path' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path'.
                                                                Types of property 'setStyle' are incompatible.
                                                                  Type '(style: L.PathOptions) => L.Path' is not assignable to type '(style: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").PathOptions) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path'.
                                                                    Types of parameters 'style' and 'style' are incompatible.
                                                                      Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").PathOptions' is not assignable to type 'L.PathOptions'.
                                                                        Types of property 'renderer' are incompatible.
                                                                          Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer | undefined' is not assignable to type 'L.Renderer | undefined'.
                                                                            Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer' is not assignable to type 'L.Renderer'.
                                                                              Types of property 'addTo' are incompatible.
                                                                                Type '(map: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map | import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").LayerGroup<any>) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer' is not assignable to type '(map: L.Map | L.LayerGroup<any>) => L.Renderer'.
                                                                                  Types of parameters 'map' and 'map' are incompatible.
                                                                                    Type 'L.Map | L.LayerGroup<any>' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map | import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").LayerGroup<any>'.
                                                                                      Type 'Map' is not assignable to type 'Map | LayerGroup<any>'.
    Overload 2 of 2, '(props: MarkerProps, context?: any): Marker<MarkerProps, Marker<any>>', gave the following error.
      Type 'Icon<IconOptions>' is not assignable to type 'Icon<IconOptions> | DivIcon | undefined'.
        Type 'Icon<IconOptions>' is not assignable to type 'DivIcon'.

  Trace: Build failed
      at /home/tim/alexandra-trackmap-panel/node_modules/@grafana/src/cli/utils/useSpinner.ts:10:13
      at step (/home/tim/alexandra-trackmap-panel/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:140:27)
      at Object.throw (/home/tim/alexandra-trackmap-panel/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:121:57)
      at rejected (/home/tim/alexandra-trackmap-panel/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:112:69)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
✖ Build failed
error Command failed with exit code 1.
Alkarex commented 3 years ago

Thanks for the bug report. I can see there is an old yarn.lock lying there. Could you please try to remove it, and/or try with npm run-script build ?

Alkarex commented 3 years ago

P.S. Could you please give a try to https://github.com/alexandrainst/alexandra-trackmap-panel/pull/49 ?

whileoneloop commented 3 years ago

Tried on master by removing yarn.lock and it works. Yep, it is fixed by #49 .

Alkarex commented 3 years ago

New release https://github.com/alexandrainst/alexandra-trackmap-panel/releases/tag/v2.2.1