Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using with angular/typescript results in error in svgdotjs #107

Open
typekpb opened this issue Nov 1, 2023 · 0 comments
Open

Using with angular/typescript results in error in svgdotjs #107

typekpb opened this issue Nov 1, 2023 · 0 comments

Comments

@typekpb
Copy link

typekpb commented Nov 1, 2023

using with typescript, I face error:

Error: node_modules/svguitar/node_modules/@svgdotjs/svg.js/svg.js.d.ts:364:9 - error TS2416: Property 'at' in type 'PointArray' is not assignable to the same property in base type 'Array<ArrayXY>'.
  Type '(pos: number) => PointArray' is not assignable to type '(index: number) => ArrayXY | undefined'.
    Type 'PointArray' is not assignable to type '[number, number]'.

364         at(pos: number): PointArray;
            ~~


Error: node_modules/svguitar/node_modules/@svgdotjs/svg.js/svg.js.d.ts:423:9 - error TS2416: Property 'at' in type 'PathArray' is not assignable to the same property in base type 'Array<PathCommand>'.
  Type '(pos: number) => PathArray' is not assignable to type '(index: number) => PathCommand | undefined'.
    Type 'PathArray' is not assignable to type 'PathCommand | undefined'.
      Type 'PathArray' is not assignable to type '["m" | "M" | "L" | "l", number, number] | ["H" | "h" | "V" | "v", number] | ["Z" | "z"] | ["C" | "c", number, number, number, number, number, number] | ["S" | "s" | "Q" | "q", number, number, number, number] | [...] | [...]'.
        Type 'PathArray' is not assignable to type '["a" | "A", number, number, number, number, number, number, number]'.

423         at(pos: number): PathArray
            ~~

Which seems to be resolved by the fix for svgdotjs: svgdotjs/svg.js#1212

Moreover, once I fixed the dependency in my: package-lock.json to versino 3.2.0:

    "node_modules/svguitar": {
      "version": "2.2.2",
      "resolved": "https://registry.npmjs.org/svguitar/-/svguitar-2.2.2.tgz",
      "integrity": "sha512-iYkuJvcvrupddzHv5sBYz++cDZIdUjL5lUy4ImMmRaIlW3OhBoeByxuGuLUuiLsImIMva0xcWsriY/03Jx2wpQ==",
      "dependencies": {
        "@svgdotjs/svg.js": "3.2.0",

the problem is no more reported.

Please upgrade svgdotjs/svg.js dependency to 3.2.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant