Code Hrelp
Unanswered
Asiatic Lion posted this in #help-forum
Asiatic LionOP
hi, trying to build a nextjs app. i have a folder called "styles" in which there is a css file called "globals.css". Tbh, I am following a yt tutorial and the programmer does this in layouts.jsx:
I do the same thing but it shows an error:
import "@styles/globals.css";
export const metadata = {
title: "Innovatica",
description: "Discover & Share AI Prompts",
};I do the same thing but it shows an error:
Module not found: Can't resolve '@styles/globals.css'
> 1 | import "@styles/globals.css";
2 | export const metadata = {
3 | title: "Innovatica",
4 | description: "Discover & Share AI Prompts",2 Replies
@Asiatic Lion hi, trying to build a nextjs app. i have a folder called "styles" in which there is a css file called "globals.css". Tbh, I am following a yt tutorial and the programmer does this in layouts.jsx:
import "@styles/globals.css";
export const metadata = {
title: "Innovatica",
description: "Discover & Share AI Prompts",
};
I do the same thing but it shows an error:
Module not found: Can't resolve '@styles/globals.css'
> 1 | import "@styles/globals.css";
2 | export const metadata = {
3 | title: "Innovatica",
4 | description: "Discover & Share AI Prompts",
American Crocodile
you need to configure absolute path
refer to this - https://blog.logrocket.com/understanding-relative-absolute-imports-next-js/
refer to this - https://blog.logrocket.com/understanding-relative-absolute-imports-next-js/