Next.js Discord

Discord Forum

Can't find CSS module in Route Group Layout

Answered
qwrts posted this in #help-forum
Open in Discord
I'm trying to create another layout inside Route Group and importing CSS but the issue is once i loaded the page. The error appears: Module not found: can't resolve './globals.css'

And its weird that the autocomplete can't even find the global css file

- I tried move global.css into Public folder and import by /globals.css
- I tried keep the css file in root /app and using root path (@) and import it by import '@/globals.css'
- I tried set the path .././globals.css to pointing it in root /app folder
Answered by West African Crocodile
in layout.tsx of root import './globals.css'
in nextjs, all of css file shared
good luck
View full answer

8 Replies

West African Crocodile
in layout.tsx of root import './globals.css'
in nextjs, all of css file shared
good luck
Answer
@West African Crocodile in layout.tsx of root import './globals.css' in nextjs, all of css file shared good luck
nothing wrong with the root layout but it happened in group route layout
West African Crocodile
I mean you don't need import css file in other tsx files without root layout
ofc, when import css in root layout
Oh i got it
How could i forget about this lmao
West African Crocodile
I am alright
thanks a lot for help