Skip to content
Source
Sign inSign up
TanStack/router

Can't access meta tags from matched routes in head #4785

Send to my agent
Closedjuliomuhlbauer(GitHub profile, opens in a new tab) opened this issue 3 comments

Which project does this relate to?

Router

Describe the bug

Image

Your Example Website or App

https://meta--tanstack-start-basic.netlify.app/meta/title

Steps to Reproduce the Bug or Issue

Demo: https://meta--tanstack-start-basic.netlify.app/meta/title (using the meta title from the parent) Repo (branch meta): https://github.com/juliomuhlbauer/tanstack-start-basic/tree/meta

Expected behavior

Get the meta tags

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.129.8
  • OS: Windows 10
  • Browser: Chrome
  • Browser Version: 138.0.7204.169
  • Bundler: Vite
  • Bundler Version: 7

Additional context

No response

  1. So in my little bit of digging it looks like the match.meta is getting updated but its happening at a later time.

    When I do the following it logs the meta properly.

    setTimeout(() => {
          const meta = match.meta;
    
          console.log("First match meta:", meta);
    
        }, 1000);

    Not sure this really helps but was just some info I found.

  2. Actually you can wait for the next tick using something like await new Promise((resolve) => setTimeout(resolve, 0)); super hacky i know

  3. I don't know if this will help, but this is how I retrieve information and dynamically obtain a head.

    Image

Sign in to join this conversation.