Next.js Discord

Discord Forum

aint fast-reloading[closed]

Answered
Auth posted this in #help-forum
Open in Discord
so i made a new project and changed layout tsx and made a folder in src which is sidebar i added sidebar in layout and now ive to restart everytime to reload and i dont see any errors
Answered by Arinji
your layout needs to have a body and html tag
View full answer

24 Replies

import "./globals.css";
import { Sidebar } from "@/components/sidebar";

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <div>
      <Sidebar />
      {children}
    </div>
  );
}
this is layout.tsx
oh now some errors came
sidebar.tsx -
import React from 'react'

export const Sidebar = () => {
  return (
   <>
<aside className="bg-black p-4">
        <div className="flex flex-col">
          <a href="#" className="mb-2">Meow</a>
          <a href="#" className="mb-2">Meow</a>
          <a href="#" className="mb-2">Meow</a>
          <a href="#" className="mb-2">Meow</a>
          <a href="#" className="mb-2">Meow</a>
          <a href="#" className="mb-2">Meow</a>
        </div>
      </aside>
   </>
  )
}
i was just starting to make
are you using the router anywhere @Auth
wait its an issue with your layout
and reinstalled
your layout needs to have a body and html tag
Answer
and it worked
@Arinji your layout needs to have a body and html tag
alright ill keep in mind
yup, if it happens again, thats the fix :D
i dont get why reinstalling worked tbh
is your layout code the same?
@Arinji i dont get why reinstalling worked tbh
reinstalling i mean
i deleted all files
then
npx create-next-app@latest
i was just starting so it wasnt much of a pain
oh kk
@Arinji your layout needs to have a body and html tag
mark this as the ans btw :D
alr