This Nextjs Code giving me an Error:
My code is using Shadcn for Ui and Convex as a backend.
My folder structure is as follow:
and my main layout file is as follow:
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import ConvexClientProvider from "../providers/ConvexClientProvider";
import { Toaster } from "@/components/ui/sonner";
import { ModalProvider } from "@/providers/modal-provider";
const inter = Inter({ subsets: ["latin"], preload: true });
export const metadata: Metadata = ({
title: "Create Next App",
description: "Generated by create next app",
});
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>
<ConvexClientProvider>
<Toaster />
<ModalProvider />
{children}
</ConvexClientProvider>
</body>
</html>
);
}
and my Dashboard layout file is as follow:
import { Navbar } from "./_components/Navbar";
import { OrgSidebar } from "./_components/Org-Sidebar";
import Sidebar from "./_components/sidebar";
interface DashboardLayoutProps {
children: React.ReactNode;
}
const DashboardLayout = ({
children,
}: DashboardLayoutProps) => {
return (
<main className="h-full">
<Sidebar />
<div className="pl-[60px] h-full">
<div className="flex gap-x-3 h-full">
<OrgSidebar />
<div className="h-full flex-1">
<Navbar />
{children}
</div>
</div>
</div>
</main>
)
}
export default DashboardLayout;
My Code is Showing me only white screen and only one warning as follow
error is : “The resource http://localhost:3000/%5C_next/static/css/app/(dashboard)/layout.css?v=1719131483630 was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.”
I want to remove this error and make my code work
Currently showing Loading Icon but not showing after that no any error but displaying white display.