Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugged: Import path correction for Next.JS (apps/www/content/docs/installation/next.mdx) #839

Merged
merged 5 commits into from
Aug 3, 2023

Conversation

GrungeElFz
Copy link
Contributor

Docs > Next.js

Next.js
Install and configure Next.js

(5) That's it

You can now start adding components to your project.

npx shadcn-ui@latest add button

The command above will add the Button component to your project. You can then import it like this:

import { Button } from "@/components/ui"
 
export default function Home() {
 return (
   <div>
     <Button>Click me</Button>
  </div>
 )
}

Ticket: #838

import { Button } from "@/components/ui" will result with:

⚠ Error (TS2307) | Cannot find module or its corresponding type declarations.

Correction: import { Button } from "@/components/ui/button"

@vercel
Copy link

vercel bot commented Jul 5, 2023

@GrungeElFz is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@dan5py dan5py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @GrungeElFz, thank you so much. Now that I look closely, also the other framework's imports are incorrect (apart from Astro). Could you please update them too?

@GrungeElFz
Copy link
Contributor Author

Hi, @dan5py 👋

I'd be happy to update the import paths from other frameworks as well 😊👍

@vercel
Copy link

vercel bot commented Jul 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 3, 2023 3:00pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-template ⬜️ Ignored (Inspect) Visit Preview Aug 3, 2023 3:00pm

@GrungeElFz
Copy link
Contributor Author

GrungeElFz commented Jul 5, 2023

@dan5py

Import path corrections :

import { Button } from "@/components/ui"⚠ Error (TS2307)
↳ ❌ Next.JS
↳ ❌ Gatsby
↳ ❌ Remix
↳ ❌ Vite

import { Button } from "@/components/ui/button" ← Correction
↳ ✅ Next.JS
↳ ✅ Gatsby
↳ ✅ Remix
↳ ✅ Vite

Copy link
Contributor

@dan5py dan5py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Thank you.

@dan5py dan5py mentioned this pull request Jul 6, 2023
@GrungeElFz
Copy link
Contributor Author

⇡ Reminder: This pull request has not been merged. [@dan5py]

@jason-hwang
Copy link

jason-hwang commented Jul 12, 2023

Let's merge asap 🛠️
I spent a little time on the correction.

@GrungeElFz Nice PR!

@GrungeElFz
Copy link
Contributor Author

⇡ Reminder: This pull request has not been merged. [@dan5py]

Copy link
Collaborator

@shadcn shadcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow this doc typo resulted in several issues and 6 DMs :)

Thanks for the fix!

@shadcn shadcn merged commit cf95943 into shadcn-ui:main Aug 3, 2023
@shadcn shadcn mentioned this pull request Aug 3, 2023
lloydrichards pushed a commit to lloydrichards/shadcn-ui that referenced this pull request Oct 3, 2023
kjxbyz pushed a commit to muse-ui/muse-ui that referenced this pull request Jun 7, 2024
artabr pushed a commit to artabr/shadcn-ui that referenced this pull request Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants