Tips

Short notes from real setup issues — path aliases, installs, and things that break quietly until TypeScript complains.

Enable the `@/` path alias

Installed files import with @/… (for example @/components/ui/button). If that alias is missing, TypeScript reports Cannot find module '@/…' even though the file is on disk.

In tsconfig.json (or jsconfig.json), set baseUrl and map @/* to the project root:

tsconfig.json
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./*"]
    }
  }
}

Next.js apps created with create-next-app usually already have this. If you started from a custom template, add it before (or right after) npx @sonojs/ui@latest add …. Restart the TypeScript server / dev process if the editor still underlines imports after saving.