-
|
Hi @lazarv, Sorry, another couple of queries coming up, regarding different libraries so will post separate discussions for each. Firstly, I have found a very nice package It seems to mostly work fine with I have a repo here which demonstrates the issue: https://github.com/nickw1/rmetest Build and run in production mode, access http://localhost:3000/, click "Edit" and you'll see the editor's CSS doesn't load correctly - but if you reload the edit page it then loads correctly. It seems to be something to do with loading the source CSS of If however I import the built CSS bundle of the package, e.g. I get an error message on build: At a guess something is non-standard about the build files for that package. I realise the error is probably in the third-party package but just wondered if you had an idea? It happens with both Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @nickw1! Why did you externalize the According to the Next.js example, this library has, you need to import these CSS files: import "@uiw/react-md-editor/markdown-editor.css";
import "@uiw/react-markdown-preview/markdown.css";I also removed the |
Beta Was this translation helpful? Give feedback.
Hi @nickw1!
Why did you externalize the
@uiw/react-md-editorpackage? After dropping thevite.config.mjsyou have in the repo, this works for me. When you externalize the package, Vite will not find the CSS imported by the library, and the framework will not include its CSS when rendering the page with the editor component. You only need to consider externalizing a package used in server components, but packages used in client components should not be externalized. This should be added as a warning in the build of a@lazarv/react-serverapplication.According to the Next.js example, this library has, you need to import these CSS files: