vbenjs / vite-plugin-svg-icons

Vite Plugin for fast creating SVG sprites.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update SVGO to fix deprecation dependency warning

felixranesberger opened this issue ยท comments

On installation of this package, a warning occurs.
This should be fixable by updating SVGO to a newer version, since the deprecated dependency stable seems
updated to a newer version in SVGO v3.

Screenshot 2023-02-04 at 18 40 04

Screenshot 2023-02-04 at 18 40 16

Hello,
I have a similar problem.
Has anyone resolved the problem?
Thanks in advance.

image

You could try using overrides to update svgo internally yourself.
Could look something like this:

"overrides": {
    "vite-plugin-svg-icons": {
      "svgo": "~3.0.0"
    }
  }

Haven't tried or tested it though.
If this works for you, it would be awesome if you could give me some feedback with your current implementation of the fix,
because I'm also facing the issue currently :)

Thank you ๐Ÿ™ for your suggestion!
But unfortunately ๐Ÿ˜ž that doesn't seem to work either.

Code package.json

{
  "name": "vite-starter",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "devDependencies": {
    "vite": "^5.2.10"
  },
  "dependencies": {
    "vite-plugin-svg-icons": "^2.0.1"
  },
  "overrides": {
    "vite-plugin-svg-icons": {
      "svgo": "~3.0.0"
    }
  }
}

obtained result
image

This could work:

"overrides": {
    "svg-baker": {
      "micromatch": "^4.0.0"
    }
  }

(svgo wasn't the problem but a sub-sub-dependency of svg-baker)

Well done ! Indeed ! ๐Ÿ‘
But there is still the stable@0.1.8 library which is causing problems now.๐Ÿค”

package.json

{
  "name": "vite-starter",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "devDependencies": {
    "vite": "^5.2.10"
  },
  "dependencies": {
    "vite-plugin-svg-icons": "^2.0.1"
  },
  "overrides": {
    "svg-baker": {
      "micromatch": "^4.0.0"
    }
  }
}

Screenshot
image

This should fix it

"overrides": {
    "svg-baker": {
      "micromatch": "^4.0.0"
    },
    "vite-plugin-svg-icons": {
      "svgo": "^3.2.0"
    }
  }

It's still the same error, I don't know why.

package.json

{
  "name": "vite-starter",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "devDependencies": {
    "vite": "^5.2.10"
  },
  "dependencies": {
    "vite-plugin-svg-icons": "^2.0.1"
  },
  "overrides": {
    "svg-baker": {
      "micromatch": "^4.0.0"
    },
    "vite-plugin-svg-icons": {
      "svgo": "^3.2.0"
    }
  }
}

Screenshot
image

Weird, did you try removing the node_modules and running npm install again?
I tried it on my project and I don't get the warning.
Haven't tried if it works yet though.

Could you resolve your error?