svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.01k stars 1.07k forks source link

How can I use release 3.0.16 with svg.filter.js? #1209

Closed PiotrFr closed 3 years ago

PiotrFr commented 3 years ago

Explanation

Error: node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:5:1 - error TS6200: Definitions of the following identifiers conflict with those in anoerence, ArrayAlias, Array, Point, PointArray, NumberUnit, Number, NumberAlias, LineCommand, CurveCommand, PathCommand, PathArrayAlias, PathArray, FlipType, ArrayXY, Coordinam, ClipPath, Container, Defs, Svg, Symbol, Element, Circle, Ellipse, Stop, Gradient, G, A, Image, PointArrayAlias, Line, Marker, Mask, Path, Pattern, Polyline, Polygon, Rect

5 declare class BuiltInArray<T> extends Array<T> { }
  ~~~~~~~

  node_modules/@svgdotjs/svg.js/svg.js.d.ts:5:1
    5 declare class BuiltInArray<T> extends Array<T> { }
      ~~~~~~~
    Conflicts are in this file.

Error: node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:484:9 - error TS2717: Subsequent property declarations must have the same type.  Proper

484         origin?: CoordinateXY | string
            ~~~~~~

  node_modules/@svgdotjs/svg.js/svg.js.d.ts:467:9
    467         origin?: CoordinateXY
                ~~~~~~
    'origin' was also declared here.

Error: 39mnode_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:658:9 - error TS2687: All declarations of 'height' must have identical modifiers.

658         height: number;
            ~~~~~~

Error: node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:658:9 - error TS2717: Subsequent property declarations must have the same type.  Proper

658         height: number;
            ~~~~~~

  node_modules/@svgdotjs/svg.js/svg.js.d.ts:640:9
    640         height?: number;
                ~~~~~~
    'height' was also declared here.

Error: node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:659:9 - error TS2687: All declarations of 'width' must have identical modifiers.

659         width: number;
            ~~~~~

Error: node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:659:9 - error TS2717: Subsequent property declarations must have the same type.  Proper

659         width: number;
            ~~~~~

  node_modules/@svgdotjs/svg.js/svg.js.d.ts:641:9
    641         width?: number;
                ~~~~~
    'width' was also declared here.

Error: node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:660:9 - error TS2687: All declarations of 'y' must have identical modifiers.

660         y: number;
            ~

Error: node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:660:9 - error TS2717: Subsequent property declarations must have the same type.  Proper

660         y: number;
            ~

  node_modules/@svgdotjs/svg.js/svg.js.d.ts:642:9
    642         y?: number;
                ~
    'y' was also declared here.

Error: node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:661:9 - error TS2687: All declarations of 'x' must have identical modifiers.

661         x: number;
            ~

Error: node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:661:9 - error TS2717: Subsequent property declarations must have the same type.  Proper

661         x: number;
            ~

  node_modules/@svgdotjs/svg.js/svg.js.d.ts:643:9
    643         x?: number;
                ~
    'x' was also declared here.

Error: node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:1329:11 - error TS2420: Class 'Circle' incorrectly implements interface 'CircleMethods'
  Type 'Circle' is missing the following properties from type 'CircleMethods': filterWith, filterer, unfilter, draggable

1329     class Circle extends Shape implements CircleMethods {
               ~~~~~~

Error: mnode_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:1341:11 - error TS2420: Class 'Ellipse' incorrectly implements interface 'CircleMethod
  Type 'Ellipse' is missing the following properties from type 'CircleMethods': filterWith, filterer, unfilter, draggable

1341     class Ellipse extends Shape implements CircleMethods {
               ~~~~~~~

Error: node_modules/@svgdotjs/svg.js/svg.js.d.ts:5:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: BuiltInArray, utils, defauntArray, NumberUnit, Number, NumberAlias, LineCommand, CurveCommand, PathCommand, PathArrayAlias, PathArray, FlipType, ArrayXY, CoordinateXY, MatrixAlias, Matrix, EventTargembol, Element, Circle, Ellipse, Stop, Gradient, G, A, Image, PointArrayAlias, Line, Marker, Mask, Path, Pattern, Polyline, Polygon, Rect, Shape, Text, Tspan, TextPath, Use, 

5 declare class BuiltInArray<T> extends Array<T> { }
  ~~~~~~~

  node_modules/@svgdotjs/svg.filter.js/node_modules/@svgdotjs/svg.js/svg.js.d.ts:5:1
    5 declare class BuiltInArray<T> extends Array<T> { }
      ~~~~~~~
    Conflicts are in this file.

Error: node_modules/@svgdotjs/svg.js/svg.js.d.ts:640:9 - error TS2687: All declarations of 'height' must have identical modifiers.

Error: node_modules/@svgdotjs/svg.js/svg.js.d.ts:641:9 - error TS2687: All declarations of 'width' must have identical modifiers.

641         width?: number;
            ~~~~~

Error: node_modules/@svgdotjs/svg.js/svg.js.d.ts:642:9 - error TS2687: All declarations of 'y' must have identical modifiers.

642         y?: number;
            ~

Error: node_modules/@svgdotjs/svg.js/svg.js.d.ts:643:9 - error TS2687: All declarations of 'x' must have identical modifiers.

643         x?: number;
            ~
Fuzzyma commented 3 years ago

Hm, you could try to change your package-lock.json to the correct version?

PiotrFr commented 3 years ago

Thanks for the tip. I use yarn. I added

 "resolutions": {
    "@svgdotjs/svg.draggable.js/@svgdotjs/svg.js": "3.0.16",
    "@svgdotjs/svg.filter.js/@svgdotjs/svg.js": "3.0.16",
    "@svgdotjs/svg.panzoom.js/@svgdotjs/svg.js": "3.0.16"
  },

to package.json