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

Failed request with fontshare font downloads #28

Closed
zmrl010 opened this issue Apr 8, 2023 · 2 comments
Closed

Failed request with fontshare font downloads #28

zmrl010 opened this issue Apr 8, 2023 · 2 comments

Comments

@zmrl010
Copy link

zmrl010 commented Apr 8, 2023

I am getting a request error when I try to download Fontshare fonts using this plugin in my sveltekit project.

image

This is my exact vite.config.ts:

import { sveltekit } from '@sveltejs/kit/vite';
import Icons from 'unplugin-icons/vite';
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
import webfontDownload from 'vite-plugin-webfont-dl';
import { defineConfig } from 'vitest/config';

export default defineConfig({
  css: {
    preprocessorOptions: {
      scss: {
        includePaths: [
          'node_modules/@bulvar/bulma',
          'node_modules/@bulvar/bulma/sass',
        ],
      },
    },
  },
  plugins: [
    sveltekit(),
    Icons({
      compiler: 'svelte',
    }),
    webfontDownload([
      'https://api.fontshare.com/v2/css?f[]=synonym@1&display=swap',
      'https://api.fontshare.com/v2/css?f[]=chillax@1&display=swap',
    ]),
    ViteImageOptimizer(),
  ],
  test: {
    include: ['src/**/*.{test,spec}.{js,ts}'],
  },
});

I've also tried:

export default defineConfig({
  plugins: [
    webfontDownload([
      'https://api.fontshare.com/v2/css?f[]=synonym@1&f[]=chillax@1&display=swap',
    ]),
  ]
})

And I tried placing <link /> tags in my source as well with no luck.

I can try and get to the bottom of this when I have some time, but maybe it is more obvious to someone already working on it.

@0xb4lint
Copy link
Member

0xb4lint commented Apr 9, 2023

Hi @zmrl010!

Thanks for raising this issue!

I've just released v3.7.1-beta.4 with support for protocol relative URLs , could you please check it?

@zmrl010
Copy link
Author

zmrl010 commented Apr 9, 2023

I can confirm that this update has fixed my issue! Thanks for publishing this fix so quickly!

@zmrl010 zmrl010 closed this as completed Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants