Localhost not running
Answered
Norwegian Forest Cat posted this in #help-forum
Norwegian Forest CatOP
⚠ Fast Refresh had to perform a full reload due to a runtime error.
✓ Compiled in 187ms (496 modules)
✓ Compiled in 131ms (496 modules)
✓ Compiled in 187ms (496 modules)
✓ Compiled in 131ms (496 modules)
44 Replies
Norwegian Forest CatOP
@Arinji I basically did some stuff
then this happened
Added a taskbar
show code
plz
Norwegian Forest CatOP
page.tsx
import Navbar from "@/components/global/navbar";
import Image from "next/image";
export default function Home() {
return (
<main>
<Navbar />
</main>
)
}
import Image from "next/image";
export default function Home() {
return (
<main>
<Navbar />
</main>
)
}
navbar.tsx
import React from "react";
type Props = {};
const Navbar = async (props: Props) => {
return (
<header className="fixed right-0 left-0 top-0 py-4 px-4
bg-black/40 backdrop-blur-lg z-[100] flex items-center
border-b-[1px] border-neutral-900 justify-between"></header>
)
};
export default Navbar;
type Props = {};
const Navbar = async (props: Props) => {
return (
<header className="fixed right-0 left-0 top-0 py-4 px-4
bg-black/40 backdrop-blur-lg z-[100] flex items-center
border-b-[1px] border-neutral-900 justify-between"></header>
)
};
export default Navbar;
dont use header
Norwegian Forest CatOP
what should i use
@Norwegian Forest Cat what should i use
anything other than header
nextjs adds its own header
so it becomes 2 headers
Norwegian Forest CatOP
Idk what else there is
i'm just doin gwhat he's doing
@Norwegian Forest Cat i'm just doin gwhat he's doing
dont follow youtube tutorials
atleast for app dir
app dir changes too much with every version
follow the docs
structure your code so there is main wrapping all your pages
Norwegian Forest CatOP
you can just see my code
lemme show a repo
Norwegian Forest CatOP
l
@Arinji remove the header :(
Norwegian Forest CatOP
it didn't help
the current error
show your layout code
Norwegian Forest CatOP
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import { ThemeProvider } from "@/providers/theme-provider";
const inter = Inter({ subsets: ["latin"] });
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}>
<ThemeProvider
attribute="class"
defaultTheme="dark"
enableSystem
disableTransitionOnChange
>
{children}
</ThemeProvider>
</body>
</html>
);
}
import { Inter } from "next/font/google";
import "./globals.css";
import { ThemeProvider } from "@/providers/theme-provider";
const inter = Inter({ subsets: ["latin"] });
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}>
<ThemeProvider
attribute="class"
defaultTheme="dark"
enableSystem
disableTransitionOnChange
>
{children}
</ThemeProvider>
</body>
</html>
);
}
looks fine, logs?
Norwegian Forest CatOP
✓ Compiled in 170ms (678 modules)
✓ Compiled in 202ms (678 modules)
⨯ The requested resource isn't a valid image for /omegariseLogo.png received text/html; charset=utf-8
✓ Compiled in 202ms (678 modules)
⨯ The requested resource isn't a valid image for /omegariseLogo.png received text/html; charset=utf-8
it looks like its trying to access the page..which url are you at
Norwegian Forest CatOP
localhost:3000
the logo isn't there yet
but even before i put the logo in the code it didn't show on localhost
looks like this is pretty much your case
Norwegian Forest CatOP
cheeeeers