#tailwindcss styling not applied. [NOT FIXED] HELP

137 messages · Page 1 of 1 (latest)

oblique orbit
#

pages/_app.js:

import "../styles/globals.css"
import {NextUIProvider} from '@nextui-org/react'

function Application({ Component, pageProps }) {
  return (
    <NextUIProvider>
      <Component {...pageProps} />
    </NextUIProvider>
  )
}

export default Application;

pages/index.js

import Head from 'next/head'
import Header from '../components/Header'
import Footer from '../components/Footer'

export default function Home() {
  return (
    <div className="container">
      <Head>
        <title>Next.js Starter!</title>
        <link rel="icon" href="/favicon.ico" />
      </Head>

      <main>
        <Header title="Welcome to my app!" />
        <p className="description">
          Get started by editing <code>pages/index.js</code>
        </p>
      </main>

      <Footer />
    </div>
  )
}

styles/globals.css

@tailwind base;
@tailwind components;
@tailwind utilities;

html,
body {
  padding: 0;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell,
    Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}

* {
  box-sizing: border-box;
}

main {
  padding: 5rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

code {
  background: #fafafa;
  border-radius: 5px;
  padding: 0.75rem;
  font-family: Menlo, Monaco, Lucida Console, Courier New, monospace;
}

.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
fathom sonnetBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

oblique orbit
#

the styles aren't applied:

#

vercel:

#

tailwind.config.js:

const { nextui } = require("@nextui-org/react");

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    // ...
    "./pages/*.{html,js,ts,jsx,tsx}",
    "./pages/**/*.{html,js,ts,jsx,tsx}",
"./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}"
  ],
  theme: {
    extend: {},
  },
  darkMode: "class",
  plugins: [nextui()]
}
#

the header

import React from "react";

import {Navbar, NavbarBrand, NavbarMenuToggle, NavbarMenuItem, NavbarMenu, NavbarContent, NavbarItem, Link, Button} from "@nextui-org/react";

 import {logo} from "../public/icon.jsx";
export default function App() {

const [isMenuOpen, setIsMenuOpen] = React.useState(false);

const menuItems = [

"Profile",

"Dashboard",

"Activity",

"Analytics",

"System",

"Deployments",

"My Settings",

"Team Settings",

"Help & Feedback",

"Log Out",

];

return (

<Navbar

isBordered

isMenuOpen={isMenuOpen}

onMenuOpenChange={setIsMenuOpen}

>

<NavbarContent className="sm:hidden" justify="start">

<NavbarMenuToggle aria-label={isMenuOpen ? "Close menu" : "Open menu"} />

</NavbarContent>

<NavbarContent className="sm:hidden pr-3" justify="center">

<NavbarBrand>

<logo />

<p className="font-bold text-inherit">ACME</p>

</NavbarBrand>

</NavbarContent>

<NavbarContent className="hidden sm:flex gap-4" justify="center">

<NavbarBrand>

<logo />

<p className="font-bold text-inherit">ACME</p>

</NavbarBrand>

<NavbarItem>

<Link color="foreground" href="#">

Features

</Link>

</NavbarItem>

<NavbarItem isActive>

<Link href="#" aria-current="page">

Customers

</Link>

</NavbarItem>

<NavbarItem>

<Link color="foreground" href="#">

Integrations

</Link>

</NavbarItem>

</NavbarContent>

<NavbarContent justify="end">

<NavbarItem className="hidden lg:flex">

<Link href="#">Login</Link>

</NavbarItem>

<NavbarItem>

<Button as={Link} color="warning" href="#" variant="flat">

Sign Up

</Button>

</NavbarItem>

</NavbarContent>

<NavbarMenu>

{menuItems.map((item, index) => (

<NavbarMenuItem key={`${item}-${index}`}>

<Link

className="w-full"

color={

index === 2 ? "warning" : index === menuItems.length - 1 ? "danger" : "foreground"

}

href="#"

size="lg"

>

{item}

</Link>

</NavbarMenuItem>

))}

</NavbarMenu>

</Navbar>

);

}
#

how to fix?

#

NextUI styling not applied. [NOT FIXED] HELP

oblique orbit
#

my tailwind.config.js is updated:

const { nextui } = require("@nextui-org/react");

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    // ...
    "./pages/**/*.{html,js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx,mdx}",
"./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}"
  ],
  theme: {
    extend: {},
  },
  darkMode: "class",
  plugins: [nextui()]
}
#

styling still not applied

#

tailwindcss styling not applied. [NOT FIXED] HELP

strong loom
#

what file path of the route in which the style is not getting applied?

oblique orbit
strong loom
#

what file path of the route in which the style is not getting applied?

oblique orbit
#

i use the header at pages/index.js

strong loom
#

can you reproduce the issue on a new project?

oblique orbit
#

wdym

strong loom
#

create a new project, try to reproduce the bug

#

try to intentionally find out what causes the bug

oblique orbit
#

i tried all the ways😭 stackoverflow, discord , kapa.ai

strong loom
#

thats not what i meant

oblique orbit
#

can i just do it in this project

#

what should i do

strong loom
#

like in this case theres too much unknonwn
it could be from NextUI?
it could be from Tailwind?
it could be from using NextUI with Tailwind?

#

You should try reproducing the bug on a new project

oblique orbit
#

what should i do in the project?

strong loom
#

try to reproduce the bug.

oblique orbit
#

i don't need to make another copy of this repo

strong loom
#

you dont need to

oblique orbit
#

i can do it in this

#

sorry i don't get it😭

strong loom
#

yeah thats because you refuse to understand

oblique orbit
#

i rlly don't get it

strong loom
#

can you identify what causes the bug?

#

can you try removing stuff

oblique orbit
#

how?

strong loom
#

like remove NextUI

oblique orbit
#

ok

strong loom
#

does the bug still persists

#

Reproducing the bugs means you do it in a new project/create a copy of your proejct and remove stuff untill you found out what causes the bug

#

Like it should be deterministic and isolated, without other unecessary stuff thats irrelevant to the bug

oblique orbit
#

wating vercel runnin to see if styling appplied 🙂

strong loom
#

have you tried npm run build and npm run start

oblique orbit
#

uh what

strong loom
#

Have you tried building the project locally

#

so you dont have to wait for Vercel to build

#

...

oblique orbit
#

im just remove importing nextui and remove it from packages

#

idk how to host local

#

im new to this stuff

#

like first creating site and install nextjs 4days ago

strong loom
#

ok so do you know you can preview your code locally?

oblique orbit
#

how

#

now i found out i forgot to push

strong loom
#

how do you code?

oblique orbit
#

😦

#

github

strong loom
#

you code using github?

oblique orbit
#

yea

strong loom
#

so no text editor app?

oblique orbit
#

it don't write the end bracketfor me

#

😦

strong loom
#

have you tried VS Code? its pretty popular for web developers

oblique orbit
#

i'll check it soon

#

(:

strong loom
#

no like, check it now

#

or ill refuse to help

oblique orbit
#

ok

strong loom
#

how do you even learn how to use NextUI?

oblique orbit
#

i want to give up

strong loom
#

how do you learn how to make next.js project?

oblique orbit
#

the header still there

oblique orbit
strong loom
#

what article did you use?

oblique orbit
#

nextjs docs

strong loom
#

how did you generate a Next.js project?

oblique orbit
#

i folliwed the steps

#

copied from netlify

#

github template

strong loom
#

ahh

oblique orbit
#

and rmeoved those netlify stuffs

strong loom
#

So

oblique orbit
#

and updatethe versions

#

🙂

#

frompackages.json

#

so i want to give up

#

the header stuck there

strong loom
#

Im just going to tell you right now, as much as you want to give up, its not really recommended to code in Github for basically anything

oblique orbit
#

even i uninstalled nextui

#

the whole page won't change

#

whole projects sucks

#

/Mark Solution

signal gorge
#

ive used nextui a lot and it works great

oblique orbit
#

can u send me your git link

#

😦

#

u can remkve all your stuffs

#

and just original ones

#

i wanna find out

#

):

signal gorge
#

Once you're setup in VSCode with Git feel free to message me

#

but it sounds like you are missing some fundamentals

oblique orbit
#

sry i can't install vscode

#

i have some personal problems

#

can u send me the pages/_app.js the index, globals styles cssfile and tailwind.condig.js?

#

🥺

strong loom
#

You dont need vscode, just get Git and any texteditor like Notepad++ or sublime

#

theres other editor that exists if you have personal problem with vscode

signal gorge
#

read this page:
https://nextui.org/docs/frameworks/nextjs

there is a template you can use to get started:
App Router:
npx create-next-app -e https://github.com/nextui-org/next-app-template

Pages Router:
npx create-next-app -e https://github.com/nextui-org/next-pages-template

#

There is also a NextUI discord server that might provide more specific help. but it's a very small community so don't expect miracles.

strong loom
#

I really want to help you but its been frustating so far. You will get better help if you cooperate and make it easier and i believe thats what we both want

signal gorge
#

Sometimes trying to solve a problem can take a long time and make us very frustrated. Take a break and come back fresh.
If you try the templates I shared you should be able to get up and running.
Highly recommend you setup a local dev environment to get started.

oblique orbit
#

i have personal problems on setting localenv

#

so i can't do that

#

i don't have console

oblique orbit
#

didn't even ever created a typescript file

#

im js newbie

signal gorge
oblique orbit
#

chatgpt doesn't work

#

it's a trash model

#

worse output

#

i'll just try

oblique orbit
signal gorge
oblique orbit
#

ok i'll just ask @quasi quest

oblique orbit
#

probelm solved!

#

/Mark Solution

frank saffron
#

ie which message (can send link)