import { run } from "@mdx-js/mdx";
import * as runtime from "react/jsx-runtime";
import { compile } from "@mdx-js/mdx";
import { remarkCodeHike } from "@code-hike/mdx";
const textTest1 = `
\`\`\`python hello.py
# mark[16:24]
print("This is Code Hike")
\`\`\`
`;
const code = await compile(textTest1, {
outputFormat: "function-body",
useDynamicImport: true,
remarkPlugins: [[remarkCodeHike]],
})
const { default: Component } = await run(code, runtime)
console.log(Component);
When executing this code on backend everything works fine and I see in the console:
[Function: MDXContent]
But the problem is that I'm running compile1 on the backend and return to the frontend string with code. Then, when I'm trying to call run I faced with an error:
@pomber Do you know any workaround or how to solve this issue?
The issue is with such sample:
When executing this code on backend everything works fine and I see in the console:
But the problem is that I'm running
compile
1 on the backend and return to the frontend string with code. Then, when I'm trying to callrun
I faced with an error:@pomber Do you know any workaround or how to solve this issue?