codehike
codehike copied to clipboard
not work after deployed to vercel
I'm running the mdx compiler on the server side on each page request, it works fine on my local machine, but on on vercel.
the error message
no such file or directory, open '/var/task/node_modules/shiki/languages/abap.tmLanguage.json'
Hi, see https://github.com/code-hike/codehike/issues/283#issuecomment-1277017015
this fixed the issue for me on getServerSideProps
// in your next.js page export const config = { unstable_includeFiles: ['node_modules/**/shiki/**/*.json'], };
I'm using the remix framework. what config should I apply?
should be fixed with v0.8.0, let me know how it goes
Could not resolve "@code-hike/mdx/dist/components.cjs.js"
I'm using it with mdx-bundler.
Can you share more details? We have a remix example and a mdx-bundler example (in the examples folder), compare them with yours and check what's different
sure. I'm doing it on the server side.
import { bundleMDX } from "mdx-bundler";
import { remarkCodeHike } from "@code-hike/mdx";
import theme from "shiki/themes/nord.json";
export const loader = async () => {
const data = await fetchFromCRM();
const result = await bundleMDX({
source: data,
mdxOptions(options, frontmatter) {
options.remarkPlugins = [
...(options.remarkPlugins ?? []),
[
remarkCodeHike,
{
showCopyButton: true,
theme,
},
],
];
return options;
},
});
return { result }
}
hmm, you may need to use autoImport: false