shadcn-ui / next-template

A Next.js 13 template for building apps with Radix UI and Tailwind CSS.
https://template.shadcn.com
1.35k stars 203 forks source link

⚡ Next13.3 | app dir #4

Closed salvaoo closed 1 year ago

salvaoo commented 1 year ago

Configuration changes

Nextjs app dir changes

shadcn commented 1 year ago

@salvaoo so the idea here is to keep this template using pages and add a new one that uses app dir when it goes stable.

I'm going to think how we can handle both and get back to this PR.

Appreciate the help. Thank you

salvaoo commented 1 year ago

@salvaoo so the idea here is to keep this template using pages and add a new one that uses app dir when it goes stable.

I'm going to think how we can handle both and get back to this PR.

Appreciate the help. Thank you

Looking at this I see it makes sense so I have created a small CLI tool using your template(pages) and my fork(app), in this CLI I give the user the option to select pages or app for his template and also the name of his project.

Take a look at it when you have time, I think it's simple and the two versions pages(stable) and app(experimental) are maintained. create-next-template.

Roopaish commented 1 year ago

@salvaoo I am getting this error with your pull request.

Failed to compile

./components/ui/dropdown-menu.tsx
Module parse failed: Bad character escape sequence (2:98)
| import { createProxy } from "next/dist/build/webpack/loaders/next-flight-loader/module-proxy"
> const proxy = createProxy("W:\next-template\components\ui\dropdown-menu.tsx")
| 
| // Accessing the __esModule property and exporting $$typeof are required here.
Roopaish commented 1 year ago

Okay solved by switching to canary release. This issue was on Windows only mentioned here #47736

salvaoo commented 1 year ago

@Roopaish From what I see it seems to be a problem that Next has been having for several versions.. Can you give me more information about it?

Roopaish commented 1 year ago

Yep, it was due to some issues with the Next.js versions, which only occur on Windows. I fixed the problem by clearing the .next folder and using "next": "^13.3.1-canary.12". Your template is now working properly, although it takes 3-4 seconds to compile, which is understandable since I'm using unstable features.

salvaoo commented 1 year ago

I saw you updated the template after your big update on @shadcn/ui hahaha I'll try your new template on my next project! Thanks for keeping it updated, I close this PR 😄