Comments (8)
Available in https://github.com/vueuse/head/releases/tag/v0.8.0, will be shipped to Nuxt in the next few days
from head.
I was able to workaround this by calling useHead
in middleware. I was originally setting it in a layout file, so moving the call further up the execution stack works. Not sure why this matters, but hope it helps.
from head.
was able to workaround this by calling
useHead
in middleware. I was originally setting it in a layout file, so moving the call further up the execution stack works. Not sure why this matters, but hope it helps.
This most definitely helps! I moved my offending useHead
declaration from app.vue to a plugin (note: using the vue:setup
hook) and it works like a charm. Thanks for the tip!
from head.
@antfu Hey Anthony, any ideas on why this is happening and how to resolve it? Unfortunately nuxt/bridge#277 didn't address the issue.
from head.
Here's a possibly dumb idea:
What if we just debounced updateDOM()
? This is what's happening:
- Server populates the head with proper styles
- Client begins hydrating
- The first couple
updateDOM()
calls don't have everything yet updateDOM()
is called several times in a row, and by the last update, all head items are present
Does updateDOM()
really need to set the head a bunch of times in a row? I made my own local patch and I'm debouncing updateDOM()
by 500ms. This fixes the background color flash.
This feels pretty hacky to me, so I'm sure there's a better way.
from head.
Also running into the same issue using vueuse/head: 0.7.9 in nuxt: 3.0.0-rc.8.
from head.
The workaround doesn't work for me, unfortunately, since I don't have enough data in the middleware to actually populate the head.
from head.
Temporary workaround using a debounce function seems to solve it: #78 (comment), will need to investigate if there's something more elegant
from head.
Related Issues (20)
- default meta description is not getting replaced HOT 1
- How to get type of script from useHead()? HOT 5
- Options API Dynamic Title HOT 3
- Issues when transpiling typeScript into javaScript HOT 6
- useHead script `children` vulnerable to XSS HOT 4
- the requested module does not provide an export named 'default' HOT 1
- website link HOT 1
- useHead does not working with vue router HOT 3
- change icon not work HOT 3
- Dependency not met HOT 2
- Noscript still seems to not be working HOT 1
- How to add "custom-element" tag to script HOT 3
- Deduping from initial head not working HOT 4
- Optional chaining are not compiled to ES5 HOT 2
- @vueuse/head not working properly with vite-plugin-ssr in SSR mode HOT 6
- Why do tags stay despite route change? HOT 9
- Issue with useServerHead or useHead with Vue 2.7 + Vite + Vue Router HOT 3
- Vue 2.5 support HOT 1
- The installation guide link is pointing to a broken link HOT 2
- Google is lowering my indexed pages every day
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from head.