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

[bug]: /docs/components/dock wrong import #430

Closed
99power opened this issue Dec 1, 2024 · 2 comments
Closed

[bug]: /docs/components/dock wrong import #430

99power opened this issue Dec 1, 2024 · 2 comments

Comments

@99power
Copy link

99power commented Dec 1, 2024

The import path should be "@/components/ui/dock.tsx" instead of
import { Dock, DockIcon } from "@/components/magicui/dock";

@mazipan
Copy link
Contributor

mazipan commented Dec 2, 2024

We can do monkey-patch to fix this bug. Since it effect many of doc page, it will hard to update it one by one, also I still can not found the source of this kind of code coming from.

Insert this code before Line: 184 in file: content-collections.ts#L184

// Should be place before Line 184 in 
// https://github.com/magicuidesign/magicui/blob/main/content-collections.ts#L184


if (body.includes('@/components/magicui')) {
  // This is an intentional log, just for debug or future improvement
  console.log(
    `🐛 Patch: /${document._meta.path} contains @/components/magicui`
  );

  // Monkey-patch string in all Docs "@/components/magicui" to "@/components/ui"
  body = body.replace(/\@\/components\/magicui/gi, '@/components/ui');
}

NOTE: you also need to update the const to let for the body

Sample screenshot from my local:

Screenshot 2024-12-02 at 16 33 45

@dillionverma
Copy link
Collaborator

Fixed in latest version of code by #525 and #537!

We use default path @components/magicui/dock right now on CLI and in our code.

Let me know if you have any other feedback

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

No branches or pull requests

3 participants