Next.js Discord

Discord Forum

Tailwind styling not getting applied to the components when they are import in the app/page/js file,

Unanswered
Carolina Wren posted this in #help-forum
Open in Discord
Carolina WrenOP
I created a next js project, the project uses src directory, now I created two components Header and Sidebar inside component folder in the root dirctory for some reason the styling I am applying in the Header or Sidebar are not visible when they are imported in the app/page.js file while if the entire code is copied and pasted in the page.js file they are working fine

8 Replies

most likely a configuration issue in your next js config file
does your content array cover the src folder
Carolina WrenOP
jsonconfig file

{
  "compilerOptions": {
    "paths": {
      "@/*": ["./src/*"]
    }
  }
}
if this is what you are talking about
no, your tailwind config file
Carolina WrenOP
Okay got you bro
Moved the components folder inside the src directory and now it is working
Thanks dude