With the new app directory, all route directories must have a page.js, page.jsx or a page.tsx file to be visible publicly (eg: mywebsite.com/about requires a file app/about/page.js). But when I try with MDX file app/about/page.mdx, and use nextMDX @next/mdx, I got a 404 not found.
Here is my next.config.mjs configuration file:
import nextMDX from "@next/mdx";
import remarkFrontmatter from "remark-frontmatter";
import rehypeHighlight from "rehype-highlight";
const withMDX = nextMDX({
extension: /\.(md|mdx)$/,
options: {
remarkPlugins: [remarkFrontmatter],
rehypePlugins: [rehypeHighlight],
},
});
const nextConfig = {
experimental: {
appDir: true,
}
};
export default withMDX({
...nextConfig,
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"],
});
Thanks for any response