-
Notifications
You must be signed in to change notification settings - Fork 22
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
Error when building for production using SCSS configFile #74
Comments
@AasmundN you need to add |
@AasmundN Try disabling experimental: {
inlineSSRStyles: false,
} |
Experimental |
It seems using Vuetify |
Okay. Is that a problem? I'm not really familiar with what inlineSSRStyles does. Or how the styles are handled by Nuxt and Vite for that matter. |
The problem is the nuxt nitro renderer, since we've some .sass references we will receive the request, but it is missing, I have it working just returning an empty string when receiving the id in Vite load hook with SSR flag: we'll receive requests like this Since we're using Vuetify styles via |
Vuetify should avoid use SASS... |
It is not working... maybe I have changed so many things that now it doesn't work in my local... |
@AasmundN You can try it adding this simple Vite plugin to your nuxt config file, removing vite: {
plugins: [{
name: 'vuetify-nuxt-inline-ssr-styles',
enforce: 'pre',
load(id, options) {
if (options?.ssr && id.startsWith('/plugin-vuetify/lib/'))
return ''
}
}]
} |
Adding the Vite plugin also seems to work, and it does reduce the size of the css-file like you showed. However when I load the page from the production build there is a little "flick" of the styles, as if the styles are being applied a little after the html appears. |
Yeah, the vite plugin doesn't seem to be working properly. Is using inlineSSRStyles important? |
Still in the process of deciding what framework to choose for styling in my Nuxt project, and I would really like to use Vuetify as I have used it in other SPA, Vite projects. However, adding Vuetify to Nuxt has been quite painful and things don't seem to work properly at every other turn. I'm not so familiar with how Vite works, but I've been trying to understand wether or not this inline styles thing is a deal breaker or not, and thus if I should choose some other styling framework instead. Or would it just marginally change the load time. If it is important, will eventually work more into fixing it? Thank you for your work, a module like this one is really needed. |
Having an issue when trying to build the app for production: https://ibb.co/HrsK1F3.
Here is my nuxt config:
My dependencies:
Help would be much appreciated.
The text was updated successfully, but these errors were encountered: