Open ArnieHung opened 1 year ago
Dear, Like you guessed, until Gatsby 5.3 it didn't support ESM. So, you need to use remark-math^3.0.1 and rehype-katex^5.0.0 with your Possible solutions style. And like I mentioned in https://github.com/gatsbyjs/gatsby/issues/21866#issuecomment-1399181236 load katex css in gatsby-ssr.js file like below:
const HeadComponents = [
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css"
integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X"
crossorigin="anonymous"
></link>
]
export const onRenderBody = ({ setHeadComponents }) => {
setHeadComponents(HeadComponents)
}
Description
gatsby develop
, the following warnings show up despite it's been successfully built:// gatsby-config.js { resolve: 'gatsby-plugin-mdx', options: { extensions: ['.mdx', '.md'], remarkPlugins: [require('remark-math')], rehypePlugins: [require('rehype-katex')], }, },