Open aymanechaaba1 opened 8 months ago
clicking the stackblitz example at canary examples with-mdx leads to this error:
~/projects/gqaibxlmy.github
❯ npm install && npx next dev
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @mdx-js/react@1.6.22
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! react@"^18.2.0" from the root project
npm ERR! peer react@"^18.2.0" from next@14.0.4
npm ERR! node_modules/next
npm ERR! next@"latest" from the root project
npm ERR! 2 more (react-dom, styled-jsx)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.13.1 || ^17.0.0" from @mdx-js/react@1.6.22
npm ERR! node_modules/@mdx-js/react
npm ERR! @mdx-js/react@"^1.6.18" from the root project
npm ERR! @mdx-js/react@"1.6.22" from @mdx-js/loader@1.6.22
npm ERR! node_modules/@mdx-js/loader
npm ERR! @mdx-js/loader@"^1.5.1" from the root project
npm ERR! 1 more (@next/mdx)
npm ERR!
npm ERR! Conflicting peer dependency: react@17.0.2
npm ERR! node_modules/react
npm ERR! peer react@"^16.13.1 || ^17.0.0" from @mdx-js/react@1.6.22
npm ERR! node_modules/@mdx-js/react
npm ERR! @mdx-js/react@"^1.6.18" from the root project
npm ERR! @mdx-js/react@"1.6.22" from @mdx-js/loader@1.6.22
npm ERR! node_modules/@mdx-js/loader
npm ERR! @mdx-js/loader@"^1.5.1" from the root project
npm ERR! 1 more (@next/mdx)
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /home/.npm/_logs/2024-01-05T16_01_42_053Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in:
npm ERR! /home/.npm/_logs/2024-01-05T16_01_42_053Z-debug-0.log
@bionicles MDX didn't work for me 🙁
@bionicles MDX didn't work for me 🙁
Sorry to hear you're struggling with it, always remember: strength through struggle!
I took some time to look at my code for a project I wrote a while ago which uses mdx, and here is a link to the key dependency "next-mdx-remote."
It was back before they changed the router but looks like they still maintain it and it's worth a shot.
Link to the code that reproduces this issue
https://github.com/aymanechaaba1/nextjs-mdx
To Reproduce
npm i
npm run dev
Current vs. Expected behavior
MDX is not displaying the style of usual MD files after following the exact steps in the doc. MDX NextJS Doc
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
MDX (@next/mdx)
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response