Open aripalo opened 3 months ago
In case someone else has this problem, one hacky-workaround could be configuring this into package.json
:
"overrides": {
"@iconify/tools": {
"@types/cheerio": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz"
}
},
Package.json overrides allow to override the version of any dependency, but as npm accepts tgz url as version, I'm pointing it to the cheerio package instead.
What version of
astro-icon
are you using?v1.1.0
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Not directly a bug in
astro-icon
, but a bug that has been fixed inastro-icon
's depedencies.@iconify/tools had an issue (that is fixed now) where it installed
@type/cheerio
package even thoughcheerio@1.0.0-rc.12
(which it uses) comes with its own (correct) type definitions.You can see the transitive dependency of
@types/cheerio
in astro-icon'spnpm-lock.yaml
.When using
cheerio@1.0.0-rc.12
in one's own codebase, this can lead to type errors as TypeScript is incorrectly resolving the types from@types/cheerio
(and not thecheerio
package itself).I acknowledge that the fix would require a major version bump for
@iconify/tools
from v3 to v4, so this might require more work than just version bump, but I still feel this is an issue worth mentioning (and creating an issue for).What's the expected result?
We'll I'd like
astro-icon
to bump up its depedency of@iconify/tools
from v3 to v4, so that one wouldn't have to deal with the incorrect@types/cheerio
.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-8hrtln?file=src%2Fdemo.ts