Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

boyjarv's avatar

Error in nextTick: "RangeError: Maximum call stack size exceeded"

Please help,

here is my View:

<template>
  <div v-if="loadedUsers" class="container mx-auto w-full">
    <UsersList :users="usersInfo" />
  </div>
</template>

<script>
import UsersList from "@/components/UsersList.vue";

export default {
  name: "UsersList",
  components: {
    UsersList,
  },
  data() {
    return {
      loadedUsers: false,
      usersInfo: [
        {
          id: 1,
          name: "Justin Hughes",
          photo: "https://randomuser.me/api/portraits/men/21.jpg",
        },
        {
          id: 2,
          name: "Amanda Johnson",
          photo: "https://randomuser.me/api/portraits/women/22.jpg",
        },
        {
          id: 3,
          name: "Andrew Price",
          photo: "https://randomuser.me/api/portraits/men/23.jpg",
        },
        {
          id: 4,
          name: "Isla Collins",
          photo: "https://randomuser.me/api/portraits/women/24.jpg",
        },
        {
          id: 5,
          name: "Margaret Turner",
          photo: "https://randomuser.me/api/portraits/women/25.jpg",
        },
        {
          id: 6,
          name: "Patrick Kelly",
          photo: "https://randomuser.me/api/portraits/men/26.jpg",
        },
        {
          id: 7,
          name: "Laura Wood",
          photo: "https://randomuser.me/api/portraits/women/27.jpg",
        },
        {
          id: 8,
          name: "Jose Wright",
          photo: "https://randomuser.me/api/portraits/men/28.jpg",
        },
        {
          id: 9,
          name: "Charlie Edwards",
          photo: "https://randomuser.me/api/portraits/men/29.jpg",
        },
        {
          id: 10,
          name: "Janet Turner",
          photo: "",
        },
        {
          id: 11,
          name: "Eric Moore",
          photo: "https://randomuser.me/api/portraits/men/31.jpg",
        },
        {
          id: 12,
          name: "Carolyn Thompson",
          photo: "",
        },
        {
          id: 13,
          name: "Barbara Wood",
          photo: "https://randomuser.me/api/portraits/women/33.jpg",
        },
        {
          id: 14,
          name: "David Anderson",
          photo: "https://randomuser.me/api/portraits/men/34.jpg",
        },
        {
          id: 15,
          name: "Nicole Clarke",
          photo: "https://randomuser.me/api/portraits/women/35.jpg",
        },
        {
          id: 16,
          name: "Brenda Wilson",
          photo: "https://randomuser.me/api/portraits/women/36.jpg",
        },
        {
          id: 17,
          name: "Kenneth Phillips",
          photo: "",
        },
        {
          id: 18,
          name: "Michelle Hill",
          photo: "https://randomuser.me/api/portraits/women/38.jpg",
        },
      ],
    };
  },
  mounted() {
    this.loadedUsers = true;
  },
};
</script>

and here is my UserList.vue component

<template>
  <div>
    <h1 class="text-3xl font-bold underline p-8">Users</h1>
    <ul class="flex flex-wrap justify-items-between">
      <li
        v-for="(user, index) in users"
        :key="index"
        class="w-full md:w-72 min-h-32 mx-4 my-12"
      >
        <div
          class="
            md:w-72
            h-full
            bg-gray-200
            rounded
            flex flex-col
            text-center
            flex
          "
        >
          <span class="mx-auto"
            ><img
              v-if="user.photo"
              :src="user.photo"
              :alt="user.name"
              class="rounded-full -my-12 border-2 border-white w-28" />
            <img
              v-else
              src="@/assets/user.png"
              :alt="user.name"
              class="rounded-full -my-12 border-2 border-white w-28"
          /></span>
          <div class="flex flex-col mt-12 p-6">
            <span class="font-bold text-xl">{{ user.name }}</span>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "UsersList",
  props: {
    users: Array,
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>

Why is my page crashing?

0 likes
9 replies
boyjarv's avatar

my homeView.vue page is very similar, I have another data object

click's avatar

You don't get a javascript tracktrace that can help you identify where the issue is coming from? As in this code you do not call this.$nextTick()

If you don't know the error or where to look the best approach is to remove parts of your code and see if the error disappears. The moment the error disappears you have at least a little clue where to look.

boyjarv's avatar

One page works and the other doesn't it is more or less identical so By removing the page bit by bit wouldn't make a difference

boyjarv's avatar

It all breaks when I click on Users link

boyjarv's avatar

ok it doesn't like my component UsersList.vue for some reason, which is more or less identical to DriversList.vue??!

boyjarv's avatar

fixed, I'm not sure how I did it just created a new component and readded everythinig

Please or to participate in this conversation.