rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.

Home Page:https://rehype-pretty.pages.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

404 on theme, 404 on some wasm code, unified no longer renders after adding as plugin

nhtyy opened this issue · comments

commented
useEffect(() => {
    const processContent = async () => {
      const result = await unified()
        .use(remarkParse)
        .use(remarkMath)
        .use(remarkRehype)
        .use(rehypeKatex)
        .use(rehypeStringify)
        .use(remarkImages)
        .use(rehypePrettyCode)
        .process(content);
      setRenderedContent(result.toString());
    };

    processContent().catch(console.error);
  }, [content]);

heres how im using the plugin, all content should be valid markdown (checked manually)

and the errors:

Failed to load resource: the server responded with a status of 404 (Not Found): dist/onig.wasm

Failed to load resource: the server responded with a status of 404 (Not Found): http://localhost:3000/posts/themes/github-dark-dimmed.json

Uncaught (in promise) TypeError: Failed to execute 'compile' on 'WebAssembly': HTTP status code is not ok

commented

using next js btw, i saw someone mention something about shiki files may not make it into build

"dependencies": {
    "@next/font": "13.1.6",
    "@types/node": "18.13.0",
    "@types/react": "18.0.27",
    "@types/react-dom": "18.0.10",
    "axios": "^1.3.4",
    "eslint": "8.33.0",
    "eslint-config-next": "13.1.6",
    "next": "13.1.6",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "rehype-katex": "^6.0.2",
    "rehype-pretty-code": "^0.9.0",
    "rehype-stringify": "^9.0.3",
    "remark": "^14.0.2",
    "remark-gfm": "^3.0.1",
    "remark-html": "^15.0.2",
    "remark-images": "^3.1.0",
    "remark-math": "^5.1.1",
    "remark-parse": "^10.0.1",
    "remark-rehype": "^10.1.0",
    "shiki": "^0.14.3",
    "typescript": "4.9.5"
  }
commented

seems like its a shiki issue although not really sure 😅