Skip to content

[bug]: No import alias found in your tsconfig.json file. #6683

Open
@realizd-ai

Description

Describe the bug

I've tried several approach and with different versions of React and Shadcn but I'm getting the same error no matter what I do.

With Tailwind v4 and React 19 (as per Tailwind v4 and React 19 #6585), I execute these commands:

pnpm create next-app@canary --tailwind --eslint --typescript --app --no-src-dir
cd my-app && pnpm dlx shadcn@canary init

I get this error message:

✔ Preflight checks.
✔ Verifying framework. Found Next.js.
✔ Validating Tailwind CSS config. Found v4.
✖ Validating import alias.

No import alias found in your tsconfig.json file.
Visit https://ui.shadcn.com/docs/installation/next to learn how to set an import alias.

Setting up a project with React 18 and the non-canary latest version of Shadcn produces the same error message.

Here is my tsconfig.json:

{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/": ["./src/"]
}
},
"include": ["next-env.d.ts", "/*.ts", "/.tsx", ".next/types/**/.ts"],
"exclude": ["node_modules"]
}

I'm attempting to create an empty project with React (18 or 19), Tailwind, TypeScript, Tailwind, Shadcn.

I've tried all combos of "./src/", "src/", as well as using "pnpm dlx shadcn@latest init" and "npm install @radix-ui/react-slot", always with the same error.

I'm not a web developer so Claude, ChatGPT and DeepSeek have been going around in circles trying different approaches for some hours.

Affected component/components

All

How to reproduce

  1. pnpm create next-app@canary --tailwind --eslint --typescript --app --no-src-dir
  2. choose my-app as project name when prompted, accept default for import alias of @/*
  3. cd my-app && pnpm dlx shadcn@canary init

Codesandbox/StackBlitz link

No response

Logs

System Info

macOS, zsh

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions