-
-
Notifications
You must be signed in to change notification settings - Fork 34
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 import within the package is causing an issue with Next.js #42
Comments
@imbhargav5 uiwjs/react-md-editor#52 Hope it helps you. |
@imbhargav5 Have you solved this? |
i used like this
i can't solved this problem with error :
plz help me what should i do 😥 |
https://codesandbox.io/s/nextjs-example-react-codemirror-bimq7?file=/pages/index.js import { useEffect, useState } from "react";
function HomePage() {
const [comp, setComp] = useState();
useEffect(() => {
if (window) {
import("@uiw/react-codemirror").then((obj) => {
if (!comp) {
setComp(obj.default);
}
});
}
}, []);
const Comps = comp;
return (
<div>
{Comps && (
<Comps
value="const a = 0;"
options={{
mode: "jsx"
}}
/>
)}
</div>
);
}
export default HomePage; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using this component with Next.js, I am facing this error. Specifically at lines like these.
react-markdown-editor/src/components/CodeMirror/index.tsx
Line 6 in 2fd2077
react-markdown-editor/src/components/CodeMirror/index.tsx
Line 7 in 2fd2077
error - ./node_modules/@uiw/react-markdown-editor/lib/esm/components/CodeMirror/codemirror.css
Global CSS cannot be imported from within node_modules.
Read more: https://err.sh/next.js/css-npm
Perhaps we can expose an export that is unstyled and one that is styled?
The text was updated successfully, but these errors were encountered: