vuetify-loader icon indicating copy to clipboard operation
vuetify-loader copied to clipboard

Setting custom SASS variable often fails (using vite)

Open jhh-ncurity opened this issue 3 years ago • 3 comments

After setting custom sass variable using: https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin#customising-variables

If I run npm run dev, I get this error in console:

image

But this doesn't happen everytime. Sometimes I get no errors but intial page loads slower than usual. I wanna know if this(slow init) is normal too.

You can reproduce this error by scaffolding vuetify application with npm create vuetify, then set custom SASS variable by method linked above(offical doc).

Here is my config:

// vite.config.js

export default defineConfig({
  plugins: [
    vue(),
    // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
    vuetify({
      styles: { configFile: 'src/settings.scss' }
    })
  ],
//...and rest are defaults
// src/settings.scss
@use 'vuetify/settings' with (
    $font-size-root: 40px, 
);
// src/plugins/vuetify.js
import '@mdi/font/css/materialdesignicons.css'
import 'vuetify/styles'

import { createVuetify } from 'vuetify'

export default createVuetify({
  theme: {
    themes: {
      light: {
        colors: {
          primary: '#1867C0',
          secondary: '#5CBBF6',
        },
      },
    },
  },
})

jhh-ncurity avatar Nov 04 '22 04:11 jhh-ncurity

Did you find a way? I'm going through the same, using Nuxt3, and not alone:

https://github.com/nuxt/nuxt.js/issues/15412

carlosmouracorreia avatar Nov 10 '22 11:11 carlosmouracorreia

Any news on this @jhh-ncurity ? The steps to reproduce it are on the Nuxt Issue above @KaelWD

carlosmouracorreia avatar Nov 21 '22 14:11 carlosmouracorreia

Still happening, has anyone found a fix?

nass600 avatar Oct 24 '23 20:10 nass600