ui icon indicating copy to clipboard operation
ui copied to clipboard

init command creates a @ directory instead of using tsconfig paths (Remix) (Linux)

Open dan-cooke opened this issue 1 year ago • 4 comments

Following the guide on here:

https://ui.shadcn.com/docs/installation/remix

Gives me the following structure

/home/dan/dev/para-mvp
  ◌ .cache
  .git
  @ // this is not right
    components
    lib
  ✗ app
    ✗ routes
       ✗ _index.tsx
     entry.client.tsx
     entry.server.tsx
     globals.css
     root.tsx
  ◌ build
  ◌ node_modules
  public
   .eslintrc.cjs
   .gitignore
   .prettierrc.json
   components.json
   package-lock.json
   package.json
   postcss.config.js
   README.md
   remix.config.js
   remix.env.d.ts
   ✗ tailwind.config.js
   tsconfig.json

As you can see it seems to create a directory called @ instead of components with a tsconfig path alias

Reproduction repo

https://github.com/dan-cooke/shadcn-remix-bug

Expected behaviour

I should have a directory called components at the top level, and no directory called @

Problem

If this is intentional (for whatever reason) the tailwind config should be updated to find this file

	content: [
		'./pages/**/*.{ts,tsx}',
+++		'./@/**/*.{ts,tsx}',
		'./components/**/*.{ts,tsx}',
		'./app/**/*.{ts,tsx}',
		'./src/**/*.{ts,tsx}',
	],

NextJS

I was able to bootstrap a NextJS project no problem, so it seems like its an issue with Remix/Shadcn

Versions

Node 20.10.0 "@remix-run/dev": "^2.3.1", "@remix-run/eslint-config": "^2.3.1", "@types/react": "^18.2.20", "@types/react-dom": "^18.2.7", "autoprefixer": "^10.4.16", "eslint": "^8.38.0", "tailwindcss": "^3.3.6", "typescript": "^5.1.6" shadcn/ui 0.4.1

Operating system

Arch linux

dan-cooke avatar Dec 07 '23 20:12 dan-cooke

thank youuuu! :smile:

anonimusprogramus avatar Dec 28 '23 07:12 anonimusprogramus

I had a similar issue following the vite instructions - it created an '@' folder at the root. Using Windows during development.

jbrider avatar Jan 22 '24 03:01 jbrider

This was messing me up big time - thanks for explaining the (temporary) fix @dan-cooke

(on Windows using indie-stack)

shmuli9 avatar Jan 24 '24 18:01 shmuli9

Guys, are you sure you put paths inside compilerOptions in tsconfig.json?

If paths sits outside, it does nothing.

Let me know how it goes. I had the same problem and this solved it.

carlesandres avatar Jan 28 '24 14:01 carlesandres

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Feb 20 '24 23:02 shadcn

Guys, are you sure you put paths inside compilerOptions in tsconfig.json?

If paths sits outside, it does nothing.

Let me know how it goes. I had the same problem and this solved it.

Yes because I did not configure paths - this is purely from setting up a fresh remix project and following integration for Shadcn

dan-cooke avatar Feb 21 '24 09:02 dan-cooke