Different version of fontawesome-common-types when installing package v.0.9.0
See original GitHub issueDescribe the problem
In September-October 2021 I created a (Angular v12.2.0) project and added FontAwesome using ng add @fortawesome/angular-fontawesome@0.9.0
, then it added these references to my project:
"@fortawesome/angular-fontawesome": "^0.9.0",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/pro-light-svg-icons": "^5.15.3",
"@fortawesome/pro-regular-svg-icons": "^5.15.3",
"@fortawesome/pro-solid-svg-icons": "^5.15.3",
These packages only reference fontawesome-common-types@0.2.36
.
Today I’m creating another project using the same packages and noticed that I was getting an error when trying to pass an IconDefinition
to an object:
Icon class:
import { IconDefinition } from '@fortawesome/fontawesome-common-types';
export class MenuItem {
icon?: IconDefinition;
}
Class usage:
import { faUsers } from '@fortawesome/pro-regular-svg-icons';
this.items = [{ icon: faHomeAlt }] //Error.
The error message is this one:
Type ‘import(“%@fortawesome/pro-regular-svg-icons/node_modules/@fortawesome/fontawesome-common-types/index”).IconDefinition’ is not assignable to type ‘import(“%@fortawesome/fontawesome-common-types/index”).IconDefinition’.
That didn’t make sense until I noticed that there’s two references to fontawesome-common-types
, for 0.3.0 and for 0.2.36:
I tried updating these packages to the latest under 0.9.0, but to no avail:
"@fortawesome/angular-fontawesome": "^0.9.0", //Same
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/pro-light-svg-icons": "^5.15.4",
"@fortawesome/pro-regular-svg-icons": "^5.15.4",
"@fortawesome/pro-solid-svg-icons": "^5.15.4",
Manually adding version 0.2.36 of the fontawesome-common-types
did the trick.
"@fortawesome/fontawesome-common-types": "^0.2.36",
But it would be better if it was not necessary.
What did you expect?
Installing version 0.9.0 should use the same internal packages.
Reproducible test case
Is it needed? If so, ping me.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:6 (3 by maintainers)
Hmm, this is pretty strange as
@fortawesome/fontawesome-svg-core@1.3.0
and@fortawesome/fontawesome-common-types@0.3.0
should be marked as deprecated exactly because of these breaking changes. So they should not be installed anymore.And they are marked deprecated on the public NPM registry. But looks like packages in the Pro registry are not marked as deprecated. Any ideas why is it so @robmadole? Is it not supported by the Cloudsmith?
This is what public NPM registry shows.
And this is what Pro registry shows.
@NickeManarin I would suggest to do the below in the meantime to avoid the deprecated 1.3.0 release and 0.3.0 types being installed:
This seems to be fixed now and packages are marked as deprecated in the Pro registry. Please let us know if you still experience the issue and we’ll look more into it.