-
-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't use React Markdown with Next JS #767
Comments
https://github.com/search?q=repo%3Aremarkjs%2Freact-markdown%20useContext&type=code This is not a problem here. Needs more info |
This comment has been minimized.
This comment has been minimized.
Welcome @mshaheeruddin! 👋 Some things to consider:
|
Can this be an issue from Next JS side? I am really sure that I haven't used Context API anywhere I don't know how to check for this: Are you including multiple different versions of react on the page? (though dependencies, check your package lock file) |
Issues are not the place for Q&A, I'm copying this over to https://github.com/orgs/remarkjs/discussions/1228. |
Initial checklist
Affected packages and versions
8.0.7
Link to runnable example
No response
Steps to reproduce
I was working on a Next JS application.
As I installed react-markdown by using npm install react-markdown, and started dev server, it crashed with the error:
**Server Error
TypeError: Cannot read properties of null (reading 'useContext')
This error happened while generating the page. Any console logs will be displayed in the terminal window.**
I tried cleaning my cache [as it also happened with another package but after cleaning cache and running npm install it resolved] but it didn't solve the issue.
As I uninstall react-markdown, my app runs fine without any issues.
P.S: Just to be clear, I haven't used Context API anywhere (no state management tool at all)
Also my Node version is latest Node.js v18.16.1.
Expected behavior
It should show my app working fine
Actual behavior
Server Error
TypeError: Cannot read properties of null (reading 'useContext')
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Runtime
Other (please specify in steps to reproduce)
Package manager
No response
OS
Windows
Build and bundle tools
Next.js
The text was updated successfully, but these errors were encountered: