Hello, I am new to this community. If this is in the wrong place, I apologize and if this has been answered here (and I somehow didn’t see it) I apologize in advance.
I am learning Next.js and I am following the nextjs.org/learn tutorial. My issue is on this chapter: CSS Styling.
Problem
As I am following this tutorial, I am getting this error in VS Code when trying to import the global.css file:
Error: Cannot find module or type declarations for side-effect import of ‘@/app/ui/global.css’.
This error is only showing in VS Code, but the project seems to run fine when running the pnpm dev command.
Edit: I am also noticing this error on the global.css file: “Unknown at rule @tailwind”
Steps to Reproduce
- Installed
pnpm - Created
Next.jsapp:
npx create-next-app@latest nextjs-dashboard --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example" --use-pnpm
- Started dev server:
pnpm dev - Added global CSS to
app/layout.tsx:
import '@/app/ui/global.css'
Current Behavior
However, dev server is running and shows correct layout and updated css. (I had tried to ignore this and continue moving through next few chapters, since “if it ain’t broke, don’t fix it”)
Tailwind error screenshot:


