prism-react-renderer
prism-react-renderer copied to clipboard
code highlighting does not work in nextjs dev environment
The problem
I am trying to use prism-react-renderer
with Nextjs and Chakra-UI, however when I run next dev
which starts the Nextjs development server, I am not able to see any code that are inside the ``` code block ```. Remember the code itself is not rendered for some reason.
Here is an screenshot of what's happening:
However if I build this with next build
and try again, it shows up:
Steps to reproduce
I actually have a repo that clones this issue: Prism Code Issue Repo
The repo is for something else, however this branch is at the point where it fails. Simply do a yarn dev
or npm run dev
(after doing a npm install
or yarn install
), and simply open localhost:3000
and open the first post that should show the issue.
The things that are rendered are in the MDXComponents
present inside the /components/MDXComponents
file.
it doesn't work with nextJS ?
Well seems like this was some issue with rendering stuff, if I explicitly return it, it works.