I have a static Next.js website that renders .mdx files into coding problem editorials. To date, I have been putting the code for each page directly inside the .mdx file, but I read about the from annotation in the CodeHike docs and decided to try importing code into the respective .mdx that way.
Issue
I get the following error when adding a from annotation to my CH.Code code block.
Server Error
Error: [next-mdx-remote] error compiling MDX:
Code Hike couldn't resolve this annotation:
// from ./cribbage-on-steroids.cpp
Someone is calling the mdx compile function without setting the path.
Open an issue on CodeHike's repo for help.
Background
I have a static Next.js website that renders
.mdx
files into coding problem editorials. To date, I have been putting the code for each page directly inside the.mdx
file, but I read about the from annotation in the CodeHike docs and decided to try importing code into the respective.mdx
that way.Issue
I get the following error when adding a from annotation to my
CH.Code
code block.Info
MDX
This is the code block from my
.mdx
file:The
.mdx
andcribbage-on-steroids.cpp
are located in the same directory.JavaScript
For reference, this is the
.../solutions/[slug].js
, the file from which pages are statically generated on the site: https://github.com/gaelanmcmillan/more-generic/blob/main/src/pages/solutions/%5Bslug%5D.jsPlease let me know if you have any recommendations on resolving this problem! The from annotation seems handy. Thanks.