Next.js Discord

Discord Forum

How to find missing module?

Unanswered
EinfachNurSimon posted this in #help-forum
Open in Discord
Hey folks ^^

I want to set up a next js project and include mdx posts (didn't touch remark/rehype though). Followed the docs on nextjs.org in this issue, but had to to make some changes to the next config, because my npm run apparently couldn't handle the require statement. It now looks like this:
import nextMdx from '@next/mdx'
const withMdx = nextMdx({
  extension: /\.mdx?$/,
  options: {}
})

const nextConfig = withMdx({
  pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
})

export default nextConfig

The point is that if I request the page I am hit with the error
https://nextjs.org/docs/messages/module-not-found automatically enabled Fast Refresh for 1 custom loader
 ⨯ ./pages/test.mdx
Module not found: Can't resolve './snowfall.js'

and I can't figure out where this module comes from/which module I have to import for that.
I apologize in advance, if there is a simple fix for this. I am fairly new to Next and don't have a real idea of what I'm doing.

0 Replies