Error: Cannot find package 'next-mdx-remote' in Next.js 12 environment
See original GitHub issueHi! I’m creating a personal engineering blog using Next.js
and next-mdx-remote
and yarn-berry
.
But trying to render mdx using next-mdx-remote caused an error called Error: Cannot find package 'next-mdx-remote'
.
I tried to change it to pakcage.json>type: 'module'
and reinstall the package, but it was not resolved, so I left it as an issue.
Below is my development environment. Please refer to it. I want you to give me feedback on what I’m doing wrong.
Also, yarn-berry version is 3.1.1
.

I don’t know if it’ll help, but I’ll also attach an error message.

Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Advanced Features: Using MDX - Next.js
The @next/mdx package is configured in the next.config.js file at your projects root. It sources data from local files, allowing you to create...
Read more >next-mdx-remote - npm
Start using next-mdx-remote in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type ...
Read more >Next.js MDX blog post not building due to module not found ...
My Next.js project is failing to build on Vercel. ... ./components/Blog/BlogAuthor/BlogAuthor.tsx:1:20 Type error: Cannot find module '../.
Read more >Migrating this Blog to Next.js from Gatsby
I did not have any imports of other TS or JS files in my MDX, only a few static imports for Videos, etc....
Read more >Read and render MD files with Next.js and Nx
js to read files from the file system, parse the Markdown, and render it to HTML. In particular, we're going to see how...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Could you replicate the error in a public repo?
I have same issue, but when i re-run the command
yarn dev
the problem has solved.