shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
75.55k stars 4.74k forks source link

[bug]: Getting no import alias found for Adonis Inertia Project(mistakenly recognize as Remix project) #4795

Open fauzanrh opened 2 months ago

fauzanrh commented 2 months ago

Describe the bug

I'm encountering an error with the import alias configuration in my tsconfig.json file on an https://github.com/adonisjs/inertia-starter-kit project. The message shown is: No import alias found in your tsconfig.json file. Visit https://ui.shadcn.com/docs/installation/remix to learn how to set an import alias.

Here is my current tsconfig.json file:

{
  "extends": "@adonisjs/tsconfig/tsconfig.app.json",
  "compilerOptions": {
    "rootDir": "./",
    "outDir": "./build",
    "baseUrl": "./",
    "paths": {
      "@/*": [ "./src/*" ] // Should always point to src
      // "@/*": [ "./inertia/*" ] --> This doesn't work
    }
  },
  "exclude": [
    "./inertia/**/*",
    "node_modules",
    "build"
  ]
}

It seems like the issue could be related to this lines of code in

Affected component/components

project initialization

How to reproduce

  1. npm init adonisjs@latest
  2. setup tailwind as per docs
  3. npx shadcn@latest init

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Ubuntu 22.04 node 22

Before submitting

GradeyCullins commented 2 months ago

same issue here

x-ray-s commented 2 months ago

Rename inertia to app, getTsConfigAliasPrefix function only supports app and src dir.

Mistes974 commented 1 month ago

Same problem here, has anyone solved it?