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: Incomplete documentation for Nuxt 3 using vue-fontawesome #19836

Open
1 of 2 tasks
Ionaru opened this issue Jul 28, 2023 · 2 comments
Open
1 of 2 tasks

Bug: Incomplete documentation for Nuxt 3 using vue-fontawesome #19836

Ionaru opened this issue Jul 28, 2023 · 2 comments

Comments

@Ionaru
Copy link

Ionaru commented Jul 28, 2023

Bug description

Using the steps provided on https://fontawesome.com/docs/web/use-with/vue/use-with#nuxt for Nuxt 3 results in the message "Could not find one or more icon(s)" in the nuxt console. The icon does work eventually but gets rendered after the page is loaded (no SSR), so results in flashing.

Full error: Could not find one or more icon(s) { prefix: 'fas', iconName: 'coffee' } {}
for the code <font-awesome-icon :icon="['fa-solid', 'coffee']" />

This issue was reported a while ago here: FortAwesome/vue-fontawesome#215 and seems to still get regular traffic from people running into the same problem.

The solution @redwarff proposed in FortAwesome/vue-fontawesome#215 (comment) seems to be the best solution, the message in the console is gone and SSR seems to be working correctly for icons. It just needs to be added to the documentation.

The solution, add to nuxt.config.ts:

build: {
    transpile: [
        '@fortawesome/vue-fontawesome'
    ]
},

So the full config for Fontawesome in combination with Nuxt 3 becomes:

export default defineNuxtConfig({
    build: {
        transpile: [
            '@fortawesome/vue-fontawesome'
        ]
    },
    css: [
        '@fortawesome/fontawesome-svg-core/styles.css',
    ],
});

Please modify https://fontawesome.com/docs/web/use-with/vue/use-with#nuxt to include the extra configuration option.

Reproducible test case

N/A

Screenshots

image

Font Awesome version

FontAwesome 6 and up, vue-fontawesome 3 and up.

Serving

Font Awesome CDN, Self-hosted

Implementation

SVG+JS

Browser and Operating System

All supported operating systems and browsers.

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

Misc

As a side-note, is there a better place to report issues about the documentation or contribute to it? I couldn't find any repository holding the documentation pages.

@Ionaru Ionaru added bug needs-triage This bug needs to be confirmed labels Jul 28, 2023
@tagliala tagliala added doc fontawesome.com and removed needs-triage This bug needs to be confirmed labels Jul 29, 2023
@Ionaru
Copy link
Author

Ionaru commented Oct 22, 2023

@talbs @mlwilkerson

Could you share some information about the status of this proposed documentation change?
It's such a waste that developers keep running into the mentioned problem while there is an easy solution available.

@AMRWERY
Copy link

AMRWERY commented Jan 9, 2024

hello, i want share when i follow this docs link steps https://fontawesome.com/docs/web/use-with/vue/use-with#nuxt
and make my nuxt config like this:

css: [
    "@fortawesome/fontawesome-svg-core/styles.css",
  ],
  build: {
    transpile: ["@fortawesome/vue-fontawesome"],
  },

i still have same issue

Screenshot 2024-01-09 164918

this is font awesome version i have now

"@fortawesome/vue-fontawesome": "^3.0.5",

so any advice please ?

@robmadole robmadole self-assigned this Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants