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

Bug: Cannot find module '@fortawesome-internal-tools/fontawesome-icons/canonical' #20307

Open
1 of 2 tasks
dg-robinson opened this issue Jul 23, 2024 · 11 comments
Open
1 of 2 tasks
Assignees
Labels

Comments

@dg-robinson
Copy link

Bug description

I've just updated from 6.5.2 to 6.6.0 and I've started getting this error in every file where I import icons, which I'm doing like this:

import { light } from "@fortawesome/fontawesome-svg-core/import.macro";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

I can update all of the style packages to 6.6.0, but if I update @fortawesome/fontawesome-svg-core then I start getting this issue. The stack trace is pointing to the imports in node_modules/@fortawesome/fontawesome-svg-core/import.macro.js.

This is happening in a React app with Craco and Babel, and I'm importing the packages via npm.

Reproducible test case

No response

Screenshots

No response

Font Awesome version

v6.6.0

Serving

Other (as specified in the bug description)

Implementation

SVG+JS

Browser and Operating System

Chrome 126.0.6478.183 on macOS 14.5

Web bug report checklist

  • I have included a test case because my odds go way up that the team can fix this when I do
  • I have searched for existing issues and to the best of my knowledge this is not a duplicate
@dg-robinson dg-robinson added bug needs-triage This bug needs to be confirmed labels Jul 23, 2024
@tagliala
Copy link
Member

Hi!

Thanks for being part of the Font Awesome Community and thanks for reporting this.

Looks like a legit issue, let's assign @robmadole

Ref:

const { FAFamilyIds } = require('@fortawesome-internal-tools/fontawesome-icons/canonical')
const { FALegacyStyleIds } = require('@fortawesome-internal-tools/fontawesome-icons/legacy')

@robmadole
Copy link
Member

Yep, sure enough that's an internal tool that leaked into this module. We'll get this looked at and fixed as soon as we can.

@allsyntax
Copy link

Is this resolved? How do fix it? I'm seeing the same issue.

@tagliala
Copy link
Member

Not fixed yet, sorry. Please keep an eye on this issue and wait for it to be closed

@CarrieWDing
Copy link

Is there a list of @fortawesome/fontawesome-svg-core versions impacted by the current error?

@tagliala
Copy link
Member

99% confident that it's just 6.6.0

@dg-robinson
Copy link
Author

Is there a list of @fortawesome/fontawesome-svg-core versions impacted by the current error?

Yep, only 6.6.0. It worked fine in 6.5.2 and below. You can still upgrade the individual icon libraries to 6.6.0 though.

@mbrown1101
Copy link

Hey guys, is there an update on this or a workaround? We have 6.5.2 installed and are having this issue.

@CarrieWDing
Copy link

Hey guys, is there an update on this or a workaround? We have 6.5.2 installed and are having this issue.

We resolved the issue by removing the ^ symbol before the version number in the package.json, and then reinstalling the node_modules. Hope it helps.

@jeffgaynor
Copy link

@CarrieWDing is correct, the version needs to be locked to 6.5.2 for @fortawesome/fontawesome-svg-core only, so remove the ^. Here's a full example of the workaround:

   "@fortawesome/fontawesome-svg-core": "6.5.2",
    "@fortawesome/free-brands-svg-icons": "^6.6.0",
    "@fortawesome/pro-duotone-svg-icons": "^6.6.0",
    "@fortawesome/pro-light-svg-icons": "^6.6.0",
    "@fortawesome/pro-regular-svg-icons": "^6.6.0",
    "@fortawesome/pro-solid-svg-icons": "^6.6.0",
    "@fortawesome/react-fontawesome": "^0.2.2",
    "@fortawesome/sharp-light-svg-icons": "^6.6.0",

Reiterating a need for this fix, as it prevents standard updates.

@liz-gunther
Copy link

liz-gunther commented Aug 19, 2024

Also interested in a fix for this -- @CarrieWDing's solution worked for updating the package and the app compiles/runs fine, but we're having Cypress tests fail due to the unresolved internal dependency. I can't share the exact error message (I'm on my personal GH but the issue is happening in a project for work), but it's more or less as follows:

[webpack-dev-server] ERROR in ./x/x/x/
...
Error: /path/to/my/file.tsx: Cannot find module '@fortawesome-internal-tools/fontawesome-icons/canonical'
.... more of the stacktrace ....

Sounds like the issue is known so hopefully a fix will be in place soon :)

alternatively, if anyone can suggest a workaround for this in the meantime, I'm all ears!

gadgetmies added a commit to gadgetmies/fomoplayer that referenced this issue Sep 14, 2024
fortawesome libraries needed to be fixed to version 6.5.2 as the 6.6 has a bug
and does not work: FortAwesome/Font-Awesome#20307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants