Open Dushyant1295 opened 1 year ago
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: {} })
Hi, It could be wrong path or bad font file. It should not have anything to do with Vite.
Here is what ChatGPT says and recommend to check. https://chat.openai.com/share/5add2125-221e-4035-8cf3-04d711420b00
Hi I'm getting these issues with fonts in css
Failed to decode downloaded font
dev.local/:1 OTS parsing error: invalid sfntVersion: 154935620
This is the vite config