./node_modules/@esbuild-plugins/node-resolve/esm/index.js:37:0
Module not found: Can't resolve 'builtin-modules'
Import trace for requested module:
./node_modules/mdx-bundler/dist/index.js
./lib/mdx.js
./pages/index.js
Related to mdx-bundler
.
Solutions in this issue thread did not work for me.
Realized it was due to importing the incorrect service in the import statement.
import { getAllFilesWithType } from '@/lib/mdx' // Needed to update to getAllFilesFrontMatter
export async function getStaticProps() {
const posts = await getAllFilesFrontMatter('blog')
return { props: { posts } }
}