-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Build and dev mode are slow and got errors in logs when importing Vuetify 3 with Vite-plugin-vuetify #15412
Comments
I'm having the same output/error and get 404 errors on the browser console when running npm run dev. The error appears only when having a specific configuration file for styles - i.e, doesn't happen when pushing vuetify onto Vite plugins without arguments. I followed the same tutorial and I'm not sure what's the correct way of importing vuetify via Vite yet, so it might be related. |
I have the same issue. I have https://my.local.app/_nuxt/%EF%BF%BDplugin-vuetify:components/VIcon/VIcon.sass not working. And many other components URLs broken like that. There seems to be this NULL byte after /_nuxt/ in the URL. And this https://my.local.app/_nuxt/plugin-vuetify:components/VIcon/VIcon.sass seems to work just fine. Also in the Nuxt dev yarn console I see same problem such files cannot be found/loaded. What adds this byte and how to get rid of it? |
Maybe related to this? https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention I got this from Kael. |
Disabling https://v3.nuxtjs.org/api/configuration/nuxt-config#inlinessrstyles |
@mhfeizi could you share how have you included Vuetify 3 in your Nuxt 3 project? With plugin? But what's in nuxt.config.ts and what's in the plugin file? Because it did not help me. |
It doesn't work for me |
nuxt.config.ts export const defaultConfigs = {
ssr: true,
experimental: {
inlineSSRStyles: false
},
vite: {
ssr: {
noExternal: ["vuetify"]
}
},
modules: [
(_options, nuxt) => {
nuxt.hooks.hook(
"vite:extendConfig",
config => config.plugins?.push(vuetify({ styles: { configFile: "assets/vuetify.settings.scss" } })) as any
);
}
]
}; plugins/vueytify.ts import { createVuetify } from "vuetify";
import { aliases, mdi } from "vuetify/iconsets/mdi-svg";
export default defineNuxtPlugin(app => {
const vuetify = createVuetify({
ssr: true,
icons: {
defaultSet: "mdi",
aliases,
sets: {
mdi
}
}
});
app.vueApp.use(vuetify);
}); |
@mhfeizi thank you. Unfortunately, I still have the same errors in the Browser console and in the terminal. But your answer helped me understand and remove some of the misconfigurations I had. What do you have in assets/vuetify.settings.scss? |
I'm using Nuxt 3.13 along with Vuetify 3.0.1 and also experiencing long load times in dev mode. Here is my plugins/vuetify.ts config that may help with some of the 404 component errors above: import { createVuetify } from 'vuetify';
import * as components from 'vuetify/components';
import * as directives from 'vuetify/directives';
import { aliases, fa } from 'vuetify/iconsets/fa';
import colors from 'vuetify/lib/util/colors.mjs';
export default defineNuxtPlugin((nuxtApp) => {
const vuetify = createVuetify({
icons: {
defaultSet: 'fa',
aliases,
sets: {
fa,
},
},
theme: {
defaultTheme: 'dark',
themes: {
light: {
dark: false,
colors: {
primary: colors.blue.darken2,
secondary: colors.grey.darken3,
accent: colors.blue.accent1,
error: colors.red.accent2,
info: colors.blue.base,
success: colors.green.base,
warning: colors.orange.darken1,
},
},
dark: {
dark: true,
colors: {
primary: colors.blue.darken4,
secondary: colors.grey.darken1,
accent: colors.pink.accent2,
error: colors.red.darken2,
info: colors.blue.base,
success: colors.green.darken2,
warning: colors.orange.darken1,
},
},
},
},
components,
directives,
});
nuxtApp.vueApp.use(vuetify);
}); The import * comopnents and * directives I think are key. |
@use 'vuetify/settings' with( /* ... */ );
|
Thanks. No clue then why not working for me. I disabled the plugin, but now
I of course lack the ability to change vuetify Sass variables/settings per
component. :(
…On Wed, 16. Nov 2022 at 18:16, Mohammad Hosein Feizi < ***@***.***> wrote:
What do you have in assets/vuetify.settings.scss?
@use 'vuetify/settings' with( /* ... */ );
—
Reply to this email directly, view it on GitHub
<#15412>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAL33XQXWV3LDP7U4UU2UVDWIUJHRANCNFSM6AAAAAAR2SA2AQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I also add main.scss @use "./vuetify.settings.scss";
|
The problem is still here with Nuxt 3.0.0 stable right @alexMugen ? I got an email saying you fixed it but I assume you deleted the comment? Cheers |
Yes it's still here unfortunately |
Same issue here with Nuxt 3 stable version and Vuetify 3.1.1 |
Yeah, Vuetify 3.1.2 & Nuxt 3 showing errors in browser console when I customize SASS vars. One of the many errors received: I don't know why this gets added |
Temporary solution :
export default defineNitroPlugin((nitroApp: any) => {
nitroApp.hooks.hook("render:response", (response: any) => {
response.body = response.body.replaceAll("/_nuxt/\0", "/_nuxt/");
});
}); |
Sadly I am not seeing where this changed anything. Thanks tho. |
Maybe this has something to do with the error? https://github.com/vuetifyjs/vuetify-loader/blob/next/packages/vite-plugin/src/stylesPlugin.ts#L227 |
So you have it all working perfectly fine? I cannot get it to work, even with your suggestions in this thread. So you don't have a very slow development environment, no toolbar/layout shifts the first seconds while it is loading? If so, would it be possible for you to create a demo repository? That would be appreciated! I am currently doing some research towards Nuxt 3 compatible UI frameworks & libraries and would like to work with Vuetify. |
False alarm.. This actually worked! Thanks @mhfeizi |
@ItsMeDelanoDev here is the link to the repo with the customized variables working: https://github.com/BayBreezy/vuetify3-nuxt3-sass-customized I also hosted it on Netlify with no trouble: https://v3customized.behonbaker.com/ |
@BayBreezy I'm trying your solution but I'm not getting the variables applied in the application! Here is my When I replace @BayBreezy Even when I tried to clone your repo, It seems not to work even locally. the font-family is "Roboto" instead of "Inter" ! |
With the upgrade to Vue3, Nuxt, Vuetify, and their surrounding libraries are still not aligned, It is located in Probably the most effective solution would be wait for this PR to be merged. By the way, it can also be improved by replacing with a general-purpose plugin such as esbuild-sass-plugin instead of vite-plugin-vuetify. I think many developers, myself included, don't understand that upgrading Vue3 and Nuxt3 involves fundamental changes. |
I Will try to add those changes to vuetify nuxt module.
I Will also try esbuild. |
@coela-oss nice, esbuild sass plugin: precompile and precache. The styles once configured shouldn't change, why we need to rebuild them between dev server restarts? |
@userquin Vuetify3/Vite supports esbuild and TreeShaking, so loads only the necessary parts. They shouldn't have to look at the entire tree again and again if it worked according to specifications. |
This is definitely not a Nuxt3 issue, but I need the docs how Nuxt2 absorbs Vue3 changes and separates Nuxi, Nitro, Vite, etc. Please let me know if anyone has additional information. I may have overlooked something. Is this case's complexity, should be resolved by simply writing |
Anyone looking for Nuxt+Vuetify flavours, I have been doing a lot of trial & errors to setup some starter templates, and I have these three repos using this module (https://vuetify-nuxt-module.netlify.app/). Based on my limited testing, these templates are not throwing any errors/warnings. All these repos build fine, so they include netlify demo urls.
Feel free to improve these templates by testing them at your end, and share them with the rest of us. Also, note that all three repos have a "blank" branch, which scaffolds just the project skeleton with an empty As @userquin stated correctly, sass is slow, so these templates have sass override (for components) in nuxt.config.ts commented out. If you want to override component's sass variables, uncommented these two in the nuxt config file.
We will get there eventually! |
This works fine. But it need restart server for applying. Question. Why it does not work out of box in Nuxt? |
Can you provide a minimal reproduction? |
https://github.com/itelmenko/nuxt3-vuetify3-customisation In browser dev console I see a lot of errors:
If I add server plugin
then I don't see errors in browser console, I dont see |
You can disable Nuxt's source map option.
Combining these two workarounds might resolve the issue, but it's somewhat a messy solution. Unfortunately, the Vuetify team has no plans to maintain support for their official nuxt-vite plugin, and the Nuxt team doesn't seem inclined to do so either. On the other hand, NuxtUI is not as feature-rich as Vuetify "yet". So, we, as Vue users, find ourselves navigating this endless desert alone, hoping for a day when either NuxtUI or PrimeVue will step up to take on the responsibility. I’m feeling a bit tired, but at the same time, I’m filled with hope and readiness. I believe the switch to one of them will happen at some point this year. |
If there’s something we can fix in Nuxt, we will. (which is why I asked for a reproduction.) But as far as I’m aware these stem from issues with Vuetify. also note there is an excellent module by @userquin which solves these issues for Nuxt users. |
Could you explain what do you mean? What solution exactly? |
@itelmenko any chance you could make it a minimal reproduction? 🙏 |
@itelmenko I think Daniel is referring to this module here: https://vuetify-nuxt-module.netlify.app/ It gets rid of some of the issues posted above. I was so frustrated with the Vuetify + Nuxt integration that I created my own UI lib here: https://ui-thing.behonbaker.com/getting-started/introduction |
Or what do you mean? |
It's quite a big project: https://github.com/itelmenko/nuxt3-vuetify3-customisation/blob/main/package.json#L12-L27 Here's more about what I mean by a minimal reproductionWhy do I need to provide a reproduction?Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. What will happen?If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect. If How can I create a reproduction?We have a couple of templates for starting with a minimal reproduction: 👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as minimal as possible. See more details in our guide. You might also find these other articles interesting and/or helpful: |
Will this work? |
I recommend using this: https://github.com/userquin/vuetify-nuxt-module. |
I feel adding a third-party module to an issue reproduction might just add an extra layer of where the issue is originated from. Are you able to reproduce the issue using that module? |
There is not enough documentation.
Could you send some snippets? |
Please move this discussion to the third party module, it is not relevant to this issue |
Do you mean minimal reproduction with userquin/vuetify-nuxt-module or without it? |
Here my pr vuetifyjs/vuetify-loader#332 Nuxt reproduction there (link to open the repo in stackblitz in the readme file) using a local vite plugin tgz, you can remove the dependency and add the vuetify plugin and run the Right now we also have some vue router warnings in nuxt. The problem, vite will not show the sourcemap map. The missing source warnings is because entries in sources array in the sourcemap with file:/// prefix. |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as off-topic.
This comment was marked as off-topic.
finally it is resolved |
Check vuetifyjs/vuetify-loader#338 , there are links to Vite and Nuxt repos, check the corresponding branch. vuetify-nuxt-module works even with SASS Variables on SSR without any missing source warnings: updating SASS variables also working (HMR). Anyone using Vuetify should switch to modern SASS compiler, update vite to latest 5.4.3 version (>= 5.4.0) and replace Check these videos (can be found in Vuetify discord server in nuxt channel):
|
Environment
Darwin
v18.10.0
3.0.0-rc.13
0.6.1
npm@8.19.2
vite
app
,runtimeConfig
,build
,vite
,imports
,modules
()
,@pinia/nuxt@0.4.3
-
Reproduction
Here the link of the stackblitz: https://stackblitz.com/edit/github-2wrsdj?file=nuxt.config.ts
I tried to clean and keep only the concerned code.
Below, the code that make the bug:
nuxt-config.ts
Describe the bug
Hello,
i have this logs on dev mode and build time, from rc-11 to the rc-13 ( _thanks a lot for your work by the way ) .
It make the build and the dev mode slow.
I don't know why, it seems like it doesn't find vuetify components on SSR during the build time and npm run dev.
When i start the dev, the rendering is good after hydration.
Do you have any idea ? What i'm doing wrong ? I'm not sure this is a bug or a misunderstanding by me.
All the currents tuto on vuetify 3 / nuxt 3 just explain how to use it but none of them are talking about custom css that need to be import on vite:extendConfig
exemple https://www.the-koi.com/projects/how-to-set-up-a-project-with-nuxt3-and-vuetify3-with-a-quick-overview/
Hope there will be an official integration of vuetify 3 / nuxt 3
Thank you for your help.
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: