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

Global CSS cannot be imported from within node_modules on Next.js app #46

Closed
efadhemon opened this issue Nov 13, 2022 · 7 comments
Closed

Comments

@efadhemon
Copy link

I am using [email protected] in my next.js app. And it shows this compile 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

@doinghun
Copy link

Yeah this plugin does not work with nextjs + sanity v3

@dawnchan030920
Copy link

I'v also met this problem. Is there any way to fix it?

@efadhemon
Copy link
Author

I'v also met this problem. Is there any way to fix it?

I also don't found any solutions. some days ago it release v3.0.0 and they are mentions that it not support in next.js. until they fix it we should wait. If you find any solutions please mention me.

@Rychillie
Copy link

duplicate issue #27

@duffpop
Copy link

duffpop commented Dec 22, 2022

+1 from me. I've attempted to use next-mdx-remote in place of this package, but it's far more convoluted and troublesome.

@mustaqimarifin
Copy link

mustaqimarifin commented Dec 24, 2022

I was playing around with the app directory and it was pretty jank but it seems to be working fine now after copying over the minified css from dist folder of the @uiw/react-md-editor and imported it in app/layout.tsx

edit: I should prob add that I got that minified file after first installing @uiw/react-md-editor, copied the css from node_modules then deleted it the package just to see if it'd work without it

@efadhemon
Copy link
Author

I was playing around with the app directory and it was pretty jank but it seems to be working fine now after copying over the minified css from dist folder of the @uiw/react-md-editor and imported it in app/layout.tsx

edit: I should prob add that I got that minified file after first installing @uiw/react-md-editor, copied the css from node_modules then deleted it the package just to see if it'd work without it

I try this but not working. Can you share example how you do that.

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

6 participants