It looks like you're experiencing an issue with the <Link> component from Inertia.js in your Vue 3 application. When the page goes white, it often indicates a JavaScript error. Here are a few steps to troubleshoot and potentially resolve the issue:
-
Ensure Correct Import: Make sure that the
<Link>component is correctly imported from@inertiajs/vue3. It seems like you have already done this in your<script setup>block, but double-check for any typos or import issues.import { Link } from '@inertiajs/vue3'; -
Check Console for Errors: Open your browser's developer console and look for any error messages. These messages can provide clues about what's going wrong.
-
Verify
metaObject Structure: Ensure that themetaobject being passed as a prop contains the expected structure. Specifically, check thatmeta.linksis an array and that each link object has aurlproperty. -
Check for Null or Undefined URLs: If any of the
link.urlvalues arenullorundefined, it could cause issues. You might want to add a check to ensure that the URL is valid before rendering the<Link>component.<Link v-for="link in meta.links" v-if="link.url" :key="link.label" :href="link.url" class="relative inline-flex items-center first-of-type:rounded-l-md last-of-type:rounded-r-md px-3 py-2" :class="{ 'z-10 bg-indigo-600 text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600': link.active, 'text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:outline-offset-0': !link.active }" v-html="link.label" > </Link> -
Check for Reactive Properties: Ensure that
previousUrlandnextUrlare correctly computed and reactive. Ifprops.meta.linksis not reactive, it might not update as expected. -
Debugging: Add some
console.logstatements to check the values ofmeta,previousUrl, andnextUrlto ensure they are what you expect. -
Styling Issues: Sometimes, CSS can cause elements to not display as expected. Ensure that your CSS is not inadvertently hiding the content.
If none of these steps resolve the issue, consider creating a minimal reproduction of the problem and checking if the issue persists. This can help isolate the problem and make it easier to debug.