fuma-nama / fumadocs

The beautiful docs framework for Next.js. Alternative to Nextra
https://fumadocs.vercel.app
MIT License
1.81k stars 110 forks source link

some issues when run pnpm create fumadocs-app #517

Closed mustafaskyer closed 4 months ago

mustafaskyer commented 4 months ago

To Reproduce

  1. pnpm create fumadocs-app
  2. cd <dir> && pnpm dev
  3. I got an issue in `/app/docs/[[...slug]]/page -> import { getPage, getPages } from '../source' ( file not exist )
  4. also I got dialog close must be inside a dialog context

Current vs. Expected behavior

expect to run the app with out issues

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 20.10.0
  npm: 10.2.3
  Yarn: 1.22.19
  pnpm: 8.6.1
Relevant Packages:
  next: 14.2.4 // Latest available version is detected (14.2.4).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

MDX

Additional context

No response

mustafaskyer commented 4 months ago

examples in the repo works as expected. seems cli generate from outdate examples.

I just created a new example using the --example <repo-url> option from nextjs cli

npx create-next-app@latest --example https://github.com/fuma-nama/fumadocs/tree/dev/examples/next-mdx

also have to update package.json

"dependencies": {
    "fumadocs-core": "latest",
    "fumadocs-mdx": "latest",
    "fumadocs-ui": "latest",
    "next": "^14.2.4",
    "react": "18.3.1",
    "react-dom": "18.3.1"
  },
mustafaskyer commented 4 months ago

this issue exist in any examples. Error: DialogClose must be used within Dialog

it happens when you click on search

fuma-nama commented 4 months ago

After debugging for hours, I finally found it is due to a different version of Radix UI dialog is installed by the cmdk package. Since the React context isn't shared between different versions of Radix UI dialog, it resulted in an error unless you explicitly install a version of Radix UI dialog on your project.

I have opened an issue there and made a workaround, will release it soon.

fuma-nama commented 4 months ago

Released, welcome to give it a try

mustafaskyer commented 4 months ago

fixed. thanks for your support. appreciated @fuma-nama