MDX not rendering properly when using Next.js with TypeScript and Tailwind CSS #2387
-
Hi! I asked a very similar question on the So I'm using I followed the official tutorial by Next.js here, but the MDX is still not rendering properly (e.g. headers are not the expected size, no code blocks, etc..). Here is my const withMDX = require('@next/mdx')()
/** @type {import('next').NextConfig} */
const nextConfig = {
// Configure `pageExtensions`` to include MDX files
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
// Optionally, add any other Next.js config below
}
module.exports = withMDX(nextConfig) My
Running I also checked the Next.js repository for a similar issue someone was having with MDX and Tailwind, but they resolved it because they only had a typo somewhere. I don't have any typos anywhere as far as I can tell. So what could be preventing the MDX files from rendering properly? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 16 replies
-
Hey @hbhutta! 👋 |
Beta Was this translation helpful? Give feedback.
How styles are applied to the page is handled by Next.js
You can read their documentation https://nextjs.org/docs/pages/building-your-application/styling/css-modules#external-stylesheets
and ask their community https://nextjs.org/docs/community
The MDX community is not Next.js support.