Open sven5 opened 2 years ago
Ok, I think the cause is we're trying to use custom fonts.
options: {
custom: {
families: ['xxxx', 'xxx', 'Source Sans Pro']
}
}
We are facing the same issue with the following config
{
{
options: {
fonts: {
google2: [
{
family: "Montserrat",
axes: "wght@400;700",
},
],
},
},
resolve: `gatsby-plugin-webfonts`,
},
}
Did you find a solution @sven5 ?
@sensedrive We're no longer using gatsby-plugin-webfonts
Instead, we switched to gatsby-omni-font-loader
My development also fails with the following error:
...
success copy gatsby files - 0.128s
success Compiling Gatsby Functions - 0.131s
ERROR #11321 PLUGIN
"gatsby-plugin-webfonts" threw an error while running the onPreBootstrap lifecycle:
connect ETIMEDOUT 216.239.32.10:443
Error: connect ETIMEDOUT 216.239.32.10:443
- node:net:1187 TCPConnectWrap.afterConnect [as oncomplete]
node:net:1187:16
success onPreBootstrap - 133.385s
success createSchemaCustomization - 0.636s
...
ERROR
Module not found: Error: Can't resolve '/.cache/webfonts/webfonts.css' in
'/home/shafi/rbds-website/node_modules/.pnpm/gatsby-plugin-webfonts@2.2.2_gatsby@4.14.0/node_modules/gatsby-plugin-webfonts'
ModuleNotFoundError: Module not found: Error: Can't resolve '/.cache/webfonts/webfonts.css' in '/home/shafi/rbds-website/node_modules/.pnpm/gatsby-pl
ugin-webfonts@2.2.2_gatsby@4.14.0/node_modules/gatsby-plugin-webfonts'
...
Configured like this:
{
resolve: "gatsby-plugin-webfonts",
options: {
fonts: {
google: [
{
family: "Fira Sans",
variants: ["300", "400", "500"],
subsets: ["latin"],
fontDisplay: "swap",
strategy: "selfHosted" // 'base64' || 'cdn'
},
{
family: "Roboto Slab",
variants: ["500"],
subsets: ["latin"],
fontDisplay: "swap",
strategy: "selfHosted" // 'base64' || 'cdn'
}
]
},
formats: ["woff2", "woff"],
useMinify: true,
usePreload: true
//usePreconnect: false,
}
}
I'm having this issue, as well. I cannot pass null
when using this plugin with gatsby-theme-material-ui
.
Same issue here.
Ok, I think the cause is we're trying to use custom fonts.
Yeah, I know this is a bit late but that's not the correct syntax for this plugin you should use seflHosted
as per the documentation.
Ok, I think the cause is we're trying to use custom fonts.
Yeah, I know this is a bit late but that's not the correct syntax for this plugin you should use
seflHosted
as per the documentation.
Didnt fix it for me.
I'm getting this error trying to run
gatsby develop
we're using the latest Gatsby packages: