Skip to content
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

Markdown.css gives error in NextJs #218

Open
mnijhum opened this issue Mar 20, 2023 · 3 comments
Open

Markdown.css gives error in NextJs #218

mnijhum opened this issue Mar 20, 2023 · 3 comments

Comments

@mnijhum
Copy link

mnijhum commented Mar 20, 2023

error - ./node_modules/@uiw/react-markdown-preview/esm/styles/markdown.css
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/@uiw/react-markdown-preview/esm/index.js
@jaywcjlove
Copy link
Member

@mountianfreeskiing
Copy link

Next.JS does not support importing CSS in components, it only supports xxx.module.css in components. You may try to download the source code and move it to your local component folder. Then move markdown.css to your style folder, remove all the imports in original source code and import markdown.css file in index.css like this:
@import './markdown.css';

@jaywcjlove
Copy link
Member

@RedboxRobot https://github.com/uiwjs/next-remove-imports/tree/main/example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants