MDX pages not rendering in Gatsby.js

Joined
Oct 25, 2023
Messages
1
Reaction score
0
Hi, I am making a website using Gatsby.js and I will have a blog in this website. I am trying to use MDX pages in Gatsby.js to be properly render math (e.g. LaTeX or KaTeX) and markdown syntax. I have looked at both of these tutorials (Adding MDX pages and Adding Markdown Pages).

For example, I have a sample.mdx file with this code:

Code:
import Layout from "../components/layout";

<Layout>

# Testing header 1

## Testing header 2 and math
$f(x) = 2$

</Layout>

And I've wrapped my MDX in a JSX component as you can see here. However, when I display it, the wrapping with the JSX component works, but right now the MDX is not rendering properly:
1698253523637.png


Right now, when I run npm list:

I have all the required packages for the rendering I believe.

I also create my project with npm init gatsby if that makes a difference.

My gatsby config file is proper too:
1698253450034.png


I'm really confused about why it's not rendering properly. Any help would be appreciated. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,060
Latest member
BuyKetozenseACV

Latest Threads

Top