'Laravel Jetsream Profile page not loading on fresh install

I have performed a fresh install of Laravel Jetstream.

Upon completing all the steps outlined in the Jetstream (Inertia) set up process, the project starts up fine using the 'php artisan serve' command. I can navigate to the Dashboard page which displays properly.

However, when I click on the newly created user in the top-right of the screen then select 'Profile', the profile page does not render.

Within my console view I see the following error:

Uncaught (in promise) Error: Ziggy error: route 'verification.send' is not in the route list.

I have not made any changes to the routes since installing the new project.

Does anyone have any idea what is causing this and how to fix it please?



Solution 1:[1]

It seems like a Jetstream bug. If you don't wanna enable Email Verification.

Go to the file UpdateProfileInformationForm.php in resources/js/Pages/Profile/Partials

You'll find this line

<div v-show="user.email_verified_at === null">

You have to add

v-if="$page.props.jetstream.hasEmailVerification"

inside that div to check if the email verification is enabled.

Then that whole div should looks like this

<div v-if="$page.props.jetstream.hasEmailVerification" v-show="user.email_verified_at === null">
  <p class="text-sm mt-2">
    Your email address is unverified.

    <Link
      :href="route('verification.send')"
      method="post"
      as="button"
      class="underline text-gray-600 hover:text-gray-900"
      @click.prevent="sendEmailVerification"
    >
      Click here to re-send the verification email.
    </Link>
  </p>

  <div v-show="verificationLinkSent" class="mt-2 font-medium text-sm text-green-600">
    A new verification link has been sent to your email address.
  </div>
</div>

Solution 2:[2]

The error occurs because a link to resend the email verification has been added in the profile view. You can fix the error by enabling

Features::emailVerification()

in config/forty.php or simply removing the "Click here to re-send the verification email." link on the profile page.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Necor
Solution 2 Joel Beer