Closed RyanGaudion closed 1 month ago
thanks for reporting, will try to fix this today
Ok, I fixed that problem, but there's a bigger issue: React Server Components don't support the dot in CH.SomeClientComponent
. Not sure how I'm going to fix that one yet.
I came across what I think might be a related issue while debugging my own render errors: https://github.com/vercel/next.js/issues/50471
just an fyi because I thought it might have some amount of overlap
Same issue :(
I couldn't get it fully working, but you can work around the CI.
issue by doing this:
CodeHike.tsx
"use client";
import { CH } from "@code-hike/mdx/components";
export const Code = CH.Code;
export const Section = CH.Section;
export const SectionLink = CH.SectionLink;
export const SectionCode = CH.SectionCode;
export const Spotlight = CH.Spotlight;
export const Scrollycoding = CH.Scrollycoding;
export const Preview = CH.Preview;
export const annotations = CH.annotations;
export const Annotation = CH.Annotation;
export const Slideshow = CH.Slideshow;
export const InlineCode = CH.InlineCode;
export const CodeSlot = CH.CodeSlot;
export const PreviewSlot = CH.PreviewSlot;
export const StaticToggle = CH.StaticToggle;
Then your MDX components would use:
import * as CH from "./CodeHike";
const components = { CH };
I had another error though after that about a missing node chCodeConfig
and gave up at that point. Cool project though!
I tried the intermediate client export file trick and so far it works for me so long as I don't use the annotations features. Those error because
Could not find the module .../CodeHike.tsx#annotations#mark in the React Client Manifest.
I'm guessing React does not include components within CH.annotations
because CH.annotations
is a map not a component, whereas it successfully includes something like export const Code = CH.Code
because CH.Code
is a component.
Hi,
I'm using this with MDXRemote on NextJS 13 (app directory). When I run it normally, I get this error:
however when I add
"use client";
to the Blog Component, I then get this error: