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

Nuxt + Vuetify production mode loading css late #5966

Closed
amritk opened this issue Jun 21, 2019 · 12 comments
Closed

Nuxt + Vuetify production mode loading css late #5966

amritk opened this issue Jun 21, 2019 · 12 comments

Comments

@amritk
Copy link

amritk commented Jun 21, 2019

Version

v2.8.1

Reproduction link

https://github.com/amritk/vuetify-nuxt-repro

Steps to reproduce

Grab the repo, build and run in production mode. Make sure to have the network tab open to disable cache. You can see as you refresh that some vuetify styles load late and the elements change.

What is expected ?

There should be no jump in style as they should be loaded already from nuxt SSR.

What is actually happening?

The styles seem to be loaded via javascript so you can see the elements jump.

Additional comments?

I have also tested this with the latest vuetify 2 beta, the problem still occurs. As I wasn't sure if this was a vuetify or nuxt bug I did post it there as well.

This bug report is available on Nuxt community (#c9394)
@ghost ghost added the cmty:bug-report label Jun 21, 2019
@amritk
Copy link
Author

amritk commented Jun 21, 2019

59383094-13a5b500-8d14-11e9-84bc-d27bb0336da9.gif
Here is a gif of what happens on my app I'm trying to take to production.

@amritk
Copy link
Author

amritk commented Jun 25, 2019

As you can see here, there are a few style blocks that are added on the client but are not there on the server. How do I ensure these styles are loaded on the server?

Server:
2019-06-25:14:52:13

Client:
2019-06-25:14:52:28

@edmundpf
Copy link

edmundpf commented Jun 26, 2019

I've found a lot of CSS packages only work with nuxt in 'spa' mode that you can edit in the nuxt config, if you can isolate the components in question you can also wrap them in the <no-ssr></no-ssr> tag. This was the case with bootstrap among others

@amritk
Copy link
Author

amritk commented Jun 26, 2019

hey @edmundpf thats good for when a component is breaking on the server side. My problem however is the opposite: styles are missing server side that should be there. I'm not sure how to configure nuxt to show these styles.

@amritk
Copy link
Author

amritk commented Jun 27, 2019

Alright its the v-layout styles loading late. Any way I can pre-load them somehow?

@amritk
Copy link
Author

amritk commented Jun 27, 2019

Closing as this is a vuetify issue

@amritk amritk closed this as completed Jun 27, 2019
@mojereliev
Copy link

Hello, @amritk! Have you solved the problem?

@amritk
Copy link
Author

amritk commented Sep 9, 2020

Sorry I can't remember what fixed it! Are you using @nuxtjs/vuetify ?

@mojereliev
Copy link

Yes, i am use @nuxtjs/vuetify.
registerStylesSSR do not helped me
https://gist.github.com/adrienbaron/ca34e89bdcc939278c3bfb5f9660908b

I am just used extractCss it is solve the problem.

@DanLowo
Copy link

DanLowo commented Sep 14, 2020

@mojereliev doesn't solve the problem 😪

@amritk
Copy link
Author

amritk commented Sep 28, 2020

Sorry I can't for the life of me remember what it was that solved this specific issue. I still have the issue of the toolbar changing colour though which is sort of related.

@DanLowo
Copy link

DanLowo commented Sep 29, 2020

I've found a way to solve it...

I added vuetify style CDN ( https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css ) inside the nuxt.config.js head, as an external CSS link..

The page now loads properly..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants