-
Notifications
You must be signed in to change notification settings - Fork 133
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
Could not find one or more icon(s), except the icons show up correctly on the page. #393
Comments
+1 for me. |
I think I came across something. If you're using SSR it has issues with it. Here's what I did. I'd submit a pull-request, but I'm not exactly sure how to write a test for this.
I wrapped that code in a client if statement.
Changing that makes it work without issues. |
@Matthewenderle are you using the |
Following on from @Morpheu5 issue, i am having exactly the same problem. The icons do work and display correctly in the browser, but with lots of warnings in both the dev terminal and the browser console. here is my This is my /plugins/fontawesome.js file (nuxt 3) with fa versions below:
and in nuxt.config.ts css : [ When running npm run serve which is vues dev mode, this is what the terminal shows me : [Vue warn]: A plugin must either be a function or an object with an "install" function. In the browser, the icon is displayed OK. but console warnings :
|
Yes, I am.
|
I am having the same issue with the exact same config |
Did you try my solution? I just had to reapply it as my package updated. The line number isn't the same anymore, just need to run a search for the first line to replace. |
Someone mentioned on a discussion that it is actually required to transpile in the vite config, it fixed the error: https://github.com/nuxt/framework/discussions/3823#discussioncomment-2477885 |
I am experiencing the same thing here with the below dependencies after following the steps outlined on frontawesome.com.
I have attempted multiple sets of steps to resolve the issue, including adding the resources to the Nothing seems to work for me. |
I was able to solve this in nuxt.config.js, but transpile one dependencies: it seems vue-fontawesome needs to update their package to use es6 syntax perhaps. |
Ok so in the use case of vite managing the build process and this pesky vue-fontawesome console warning So for me, the solution was to force the production environment in the build script command (npm scripts). In my case I'm using vite-ssg for a bunch of projects, the fix is to open up the "scripts": {
"build": "vite-ssg build",
} And then update it to this: "scripts": {
"build": "NODE_ENV=production vite-ssg build",
} Leaving this comment because I literally just now spent a couple hours trying to figure out what the heck I did in some of my projects that are fixed now, versus all the projects I still have showing the warning for missing icons that aren't really missing. Maybe this helps someone else to not have to spend that time. |
Describe the bug
I'm using Nuxt 3 and vue-fontawesome 3.0.1. Occasionally, an error crops up in my logs saying an icon can't be found, except when I look at the rendered page, the icon is there. Sometimes the error doesn't show up. After a bit, the error may stop showing up, but it may come back later, and I can't figure out any way to reliably reproduce this.
Reproducible test case
I can't reliably reproduce the issue, but I followed the Nuxt 3 instructions from the docs quite faithfully.
Expected behavior
No error in the console.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: