question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Different version of fontawesome-common-types when installing package v.0.9.0

See original GitHub issue

Describe 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:

image

package-lock.json.txt

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:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
devoto13commented, Mar 29, 2022

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.
$ npm show @fortawesome/fontawesome-svg-core@1.3.0

@fortawesome/fontawesome-svg-core@1.3.0 | MIT | deps: 1 | versions: 67
The iconic font, CSS, and SVG framework
https://fontawesome.com

DEPRECATED ⚠️  - Please upgrade to 6.1.0. https://fontawesome.com/docs/changelog/

keywords: font, awesome, fontawesome, icon, svg, bootstrap

dist
.tarball: https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.3.0.tgz
.shasum: 343fac91fa87daa630d26420bfedfba560f85885
.integrity: sha512-UIL6crBWhjTNQcONt96ExjUnKt1D68foe3xjEensLDclqQ6YagwCRYVQdrp/hW0ALRp/5Fv/VKw+MqTUWYYvPg==
.unpackedSize: 374.4 kB

dependencies:
@fortawesome/fontawesome-common-types: ^0.3.0

maintainers:
- devoto13 <devoto13@gmail.com>
- jrjohnson <jon.johnson@ucsf.edu>
- robmadole <robmadole@gmail.com>
- supercodepoet <travis@travischase.me>
- fortawesome-admin <admin@fortawesome.com>
- mwilkerson <mwilkerson@gmail.com>

dist-tags:
latest: 6.1.1         next: 1.3.0-beta3     prerelease: 1.2.26-2

published a month ago by robmadole <robmadole@gmail.com>
And this is what Pro registry shows.
$ npm show @fortawesome/fontawesome-svg-core@1.3.0

@fortawesome/fontawesome-svg-core@1.3.0 | MIT | deps: 1 | versions: 69
The iconic font, CSS, and SVG framework
https://fontawesome.com

keywords: font, awesome, fontawesome, icon, svg, bootstrap

dist
.tarball: https://npm.fontawesome.com/@fortawesome/fontawesome-svg-core/-/1.3.0/fontawesome-svg-core-1.3.0.tgz
.shasum: 343fac91fa87daa630d26420bfedfba560f85885
.integrity: sha512-UIL6crBWhjTNQcONt96ExjUnKt1D68foe3xjEensLDclqQ6YagwCRYVQdrp/hW0ALRp/5Fv/VKw+MqTUWYYvPg==

dependencies:
@fortawesome/fontawesome-common-types: ^0.3.0

dist-tags:
latest: 6.1.1      next: 1.3.0-beta3

published a month ago

@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:

$ npm i --save @fortawesome/fontawesome-svg-core@~1.2.36
0reactions
devoto13commented, May 23, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular - FontAwesome Dependencies missing error
It installed successfully. Now it is giving dependency error. The target entry-point "@fortawesome/angular-fontawesome" has missing dependencies ...
Read more >
Versions of Font Awesome
Our latest, current, and most awesome version yet packed with almost twice as many icons, new categories, all of our icons in a...
Read more >
@fortawesome/angular-fontawesome - npm
Angular Fontawesome, an Angular library. Latest version: 0.12.0, last published: a month ago. Start using @fortawesome/angular-fontawesome ...
Read more >
Debian -- Software Packages in "bullseye"
Supports devel. in C/C++; brickos-doc (0.9.0.dfsg-12.2): documentation for brickOS an ... parse a string into one of the standard Common Lisp number types...
Read more >
Changelog • shiny - GitHub Pages
Shiny 1.7.0 changed the icon(lib="fontawesome") implementation from a bundled copy of fontawesome, to the {fontawesome} package. This led to issue #3688, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found