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 to decode downloaded font #11

Open
Dushyant1295 opened this issue May 27, 2023 · 2 comments
Open

Failed to decode downloaded font #11

Dushyant1295 opened this issue May 27, 2023 · 2 comments

Comments

@Dushyant1295
Copy link

Hi I'm getting these issues with fonts in css

Failed to decode downloaded font

dev.local/:1 OTS parsing error: invalid sfntVersion: 154935620


@font-face {
  font-family: Mezius;
  src:
    url("./font/ppp.ttf") format('truetype');
  font-display: swap;
}

This is the vite config



import { defineConfig } from 'vite'
import liveReload from 'vite-plugin-live-reload'
const { resolve } = require('path')

export default defineConfig({
  plugins: [
    liveReload(__dirname + '/**/*.twig')
  ],
  root: '',
  base: process.env.NODE_ENV === 'development'
    ? '/'
    : '/dist/',
  build: {
    outDir: resolve(__dirname, './dist'),
    emptyOutDir: true,
    manifest: false,
    target: 'es2018',
    rollupOptions: {
      input: {
        main: resolve(__dirname + '/main.js')
      },
      output: {
        entryFileNames: `assets/[name].js`,
        chunkFileNames: `assets/[name].js`,
        assetFileNames: `assets/[name].[ext]`
      }
    },
    minify: true,
    write: true
  },
  server: {
    cors: true,
    strictPort: true,
    port: 3000,
    https: false,
    hmr: {
      host: 'localhost'
    },
  },
  resolve: {}
})

@blonestar
Copy link
Owner

Hi,
It could be wrong path or bad font file.
It should not have anything to do with Vite.

@blonestar
Copy link
Owner

Here is what ChatGPT says and recommend to check.
https://chat.openai.com/share/5add2125-221e-4035-8cf3-04d711420b00

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