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

Seems to be version issues with contentlayer #547

Closed
igloo1505 opened this issue Jun 30, 2024 · 5 comments
Closed

Seems to be version issues with contentlayer #547

igloo1505 opened this issue Jun 30, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@igloo1505
Copy link

igloo1505 commented Jun 30, 2024

To Reproduce

fumadocs-core depends on remark 15.x, and there appears to be an issue with contentlayer and the latest version of remark and several remark and rehype dependencies as the whole unified framework goes through a major update. There's an issue here, but there are quite a few similar issues posted elsewhere.

Current vs. Expected behavior

The fumdadocs contentlayer template, without any modification produces the same error:

TypeError: Cannot read properties of undefined (reading 'inTable')

Provide environment information

Operating System:
- MacOs
- Apple silicon M1

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

Core, MDX, Integrations (e.g Contentlayer, OpenAPI, Typescript DocsGen), Examples

Additional context

This seems to be an issue with remark 15+, and all unified dependencies that recently updated to support remark 15+. I've had a similar issue with the same app before moving to fumadocs (which is otherwise awesome by the way), and was able to resolve it by setting a strict version for remark, remark-math, rehype-mathjax, and particularly remark-gfm but currently the fumadocs package is overriding that with their 15.x remark dependency.

@igloo1505 igloo1505 added the bug Something isn't working label Jun 30, 2024
@fuma-nama
Copy link
Owner

You have to override the dependency versions with overrides option in package.json

{
  "overrides": {
    "unified": "^11.0.4",
    "mdx-bundler": "^10.0.1"
  }
}

@igloo1505
Copy link
Author

I have that. The issue appears for me even in the template generated through pnpm create fumadocs-app when using the contentlayer source. I was originally using the fumadocs-mdx package, but came to the same issue on any page that included math so I tried switching to using contentlayer as a source. I have those overrides in both the app that I'm trying to build and in the generated template, and both apps are producing the same error. The generated app hasn't been modified at all.

@fuma-nama
Copy link
Owner

fuma-nama commented Jul 1, 2024

For pnpm, you need pnpm.overrides instead. Regarding the math problem, it sounds like a XY problem. You only need to follow the Math setup guide in the docs, Fumadocs MDX as a drop-in Contentlayer replacement should be able to handle that.

@fuma-nama
Copy link
Owner

Closing this as the Contentlayer adapter is now deprecated, you may consider Fumadocs MDX, Content Collections, MDX Remote or other content sources.

@fuma-nama fuma-nama closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
@igloo1505
Copy link
Author

Closing this as the Contentlayer adapter is now deprecated, you may consider Fumadocs MDX, Content Collections, MDX Remote or other content sources.

No worries. It's a great library regardless. I'll try out the other options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants