I was using font-awesome svg icons, but I realized that they might be having a significant effect on the LCP of my website, so I'm trying to replace them. I went into my html and copied the svg code, and put these svg components into svg files. They open as images in my photoshop knockoff so I figured they should be good.
When I try to include them in on my page using
import FacebookIcon from '../images/svg/facebookF.svg'
import Email from '../images/svg/email.svg'
<FacebookIcon />
<Email />
And adding the following to my gatsby-config.js
(after installing gatsby-plugin-react-svg
{
resolve: 'gatsby-plugin-react-svg',
options: {
rule: {
include: "/src/images/svg/"
}
}
}
I receive the error
InvalidCharacterError: String contains an invalid character
This error is happening in my MRE, which you can view on this Github repo. In my actual program the svgs were just not showing up, but the web page loaded fine.
svg
(e.g. images/comp1/svg, images/comp2/svg ...) – Valentine