google-fonts: Download mode is not working!
Just wanted to run a basic test with the config below nuxt.config.js
export default {
modules: [
[
'@nuxtjs/google-fonts'
],
googleFonts: {
families: {
Roboto: true,
"Roboto Mono": true,
Mali: {
wght: [400, 600, 700],
},
},
download: true
}
}
pages/index.html:
<h2 style="font-family: Roboto">Teseting Fonts Roboto</h2>
<h2 style="font-family: Roboto Mono;font-weight:bold">Teseting Fonts Roboto Monospace</h2>
<h2 style="font-family: Mali">Teseting Fonts Roboto Mali</h2>
and It’s just not working ( every text falls back to the default font ) but when I switch the download: false it works fine.
it also won’t show any errors or logs in build time.
I tried it with other options like base64, outputDir, fontsDir, fontsPath no change still not working.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 28
This seems to be working for me now. However I’m using
nuxt generateto build. Using version@nuxtjs/google-fonts 1.3.0andnuxt 2.15.6.My
nuxt.config.js:Removing the
assets/css/fonts.cssandassets/fontsworked for me! After I deleted the file and folder I ranyarn devagain.I have a similar issue, but in my case only files for the 100 weight is downloaded and only with the following config Version info: nuxt - 2.14.7 @nuxtjs/google-fonts - 1.2.0
or
When I use the following I get a bad request error during build
I can confirm that it is broken Regardless what I do, it adds a
{"rel":"stylesheet","type":"text\u002Fcss","href":"https:\u002F\u002Ffonts.googleapis.com\u002Fcss?family=Roboto:100,300,400,500,700,900&display=swap"}to the project and requests the fonts from google.Even
useStylesheet: falsedoesn’t prevents adding it as stylesheet in theheadsection.Edit: I think may case was special. I also use
vuetifyand need to add ´defaultAssets: false, to myvuetifyconfigs. https://github.com/nuxt-community/vuetify-module#defaultassetsDoing this;
instead of this:
worked for me.
seems to be working for me now on
@nuxtjs/google-fonts 1.3.0andnuxt 2.15.6.just remove the unnecessary settings.Same issue as @mayowa Roboto uses only 100 weight no matter the options used. When using wgth it fails loadings.
You can try to enable
overwritingor do as @jornwildenbeesthttps://google-fonts.nuxtjs.org/downloading#overwriting