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

nanadjei2's avatar

Cannot access 'Custom Component' before initialization

Hi, in my app I have two layouts. The "guest" layout houses the content of my page when the user has not yet logged in and the auth layout wraps my page when the user logs in. The app doesn't crash but anytime I save on hot reload, I keep getting this error in my console.

  ReferenceError: Cannot access 'AuthLayout' before initialization
    at Dashboard.vue:42:17

meanwhile, I am not even working in the dashboard.vue file.

This is how my dashboard.vue looks like:

 <template>
      <auth-layout>
		///
       </auth-layout>
 </template>

<script>
 import AuthLayout from "@/app/layouts/auth/Layout.vue";
 import Card from "@/app/pages/dashboard/reuseables/Card.vue";
 import { mapActions, mapGetters } from "vuex";
 export default {
    name: "Dashboard",
    components: { AuthLayout, Card },  // Line 42
0 likes
0 replies

Please or to participate in this conversation.