I am used Laravel 10 & Ä°nertia Js & Vite and Vue
This is console eror
caught TypeError: Cannot read properties of undefined (reading "init")
at Object.init (scripts.bundle.js:1:41)
at scripts.bundle.js:1:348
<!DOCTYPE html>
<html lang="{{ str_replace("_", "-", app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title inertia>{{ config("app.name", "Laravel") }}</title>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700" />
<link href="admin/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
<link href="admin/css/style.bundle.css" rel="stylesheet" type="text/css" />
<!-- Scripts -->
@routes
@vite(["resources/js/app.js","../public/admin/js/scripts.bundle.js", "resources/js/Pages/{$page["component"]}.vue"])
@inertiaHead
</head>
<body class="font-sans antialiased" id="kt_app_body" data-kt-app-layout="dark-sidebar" data-kt-app-header-fixed="true" data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-hoverable="true" data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true" data-kt-app-sidebar-push-footer="true" data-kt-app-toolbar-enabled="true" class="app-default">
<script>var defaultThemeMode = "light"; var themeMode; if ( document.documentElement ) { if ( document.documentElement.hasAttribute("data-bs-theme-mode")) { themeMode = document.documentElement.getAttribute("data-bs-theme-mode"); } else { if ( localStorage.getItem("data-bs-theme") !== null ) { themeMode = localStorage.getItem("data-bs-theme"); } else { themeMode = defaultThemeMode; } } if (themeMode === "system") { themeMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } document.documentElement.setAttribute("data-bs-theme", themeMode); }</script>
@inertia
<script src="{{ asset("admin/plugins/global/plugins.bundle.js") }}" defer></script>
</body>
</html>
Hi,
Thank you for reaching out to us.
Could you please try to follow Metronic default script order?
Place the theme mode setup inline script above your main content and then order your scripts as shown below:
<script src="assets/plugins/global/plugins.bundle.js"></script>
<script src="assets/js/scripts.bundle.js"></script>
<!--begin::Vendors Javascript files-->
<!--begin::Custom Javascript files-->