Vue.js SPA SEO: how I made my app invisible to Google (and how I fixed it)
The article discusses the challenges of SEO for Vue.js single-page applications (SPAs) and how the author resolved them. Initially, the author's app was not indexed by Google, showing only the homepage with a generic title. The solution involved implementing proper HTML structure and using a library to manage dynamic meta tags effectively.
- ▪The author's Vue.js SPA was not indexed by Google, resulting in poor visibility.
- ▪Google's crawler struggles with JavaScript rendering, making SEO for SPAs challenging.
- ▪The author implemented a static HTML fallback and used @unhead/vue for dynamic meta tags to improve SEO.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3833552) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Odilon HUGONNOT Posted on May 18 • Originally published at web-developpeur.com Vue.js SPA SEO: how I made my app invisible to Google (and how I fixed it) #vue #seo #spa #unhead I spent three months building CitoyenNote — a Vue.js 3 + Vite SPA. Clean code, Composition API, composables for everything, Pinia for state management. The kind of codebase you're actually proud of. Then I typed the site name into Google and got back a single result: the homepage. With a title of "Document".
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).