inertiajs / inertia

Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
https://inertiajs.com
MIT License
6.02k stars 405 forks source link

Unable to view Head attribute and <meta description> tag - When viewing source #1886

Closed Dlas1212 closed 1 month ago

Dlas1212 commented 1 month ago

Version:

Describe the problem:

Adding the Head component does not work, including adding meta description adds it when you inspect element, but if you view the source of the website, then the meta description tag is missing.

I am using this with Laravel's set up too but the package is specifically "@inertiajs/vue3": "^1.1.0",. I noticed that the "Head" items don't even get included. I even have @inertiaHead in app.blade.php

Steps to reproduce:

    <Head title="Home">
        <meta name="description" content="This is my description">
    </Head>

Inspecting the element:

Screenshot 2024-06-01 at 10 29 14 PM

Viewing Source: Nothing for "title" Home exists, even CMD+F & nothing for meta description.

Screenshot 2024-06-01 at 10 32 56 PM
RobertBoes commented 1 month ago

You need SSR in order for that to work: https://inertiajs.com/server-side-rendering

driesvints commented 1 month ago

Thanks @RobertBoes