Closed sokryptk closed 3 years ago
我有类似的问题,我使用的是@uiw/react-md-editor,我在他们的github上提了issue
我有类似的问题,我使用的是@uiw/react-md-editor,我在他们的github上提了issue
Yeah! I'm using markdown-to-jsx for the meantime, Works well!
I also have the same problem.
I’m seeing the same issue, it started with vite 2.3.0, maybe the update of esbuild?
Same here, I've dropped back to v2.2.4 for the moment.
v2.3.0 introduced some breaking changes but I didn't have any luck with the suggested workaround of using the dynamic-import-polyfill
- has anyone else had better luck?
I am facing the same issue in v2.4.2, curiously, it work in dev, no problem during build too. Wonder what's the difference between dev and build that cause this.
Hi, an update on this issue. Since this issue arises from mdast-util-to-hast
. The maintainer of said library pointed that this was a vite issue and directed me here, but since then the maintainer has fixed the circular dependency issue the lib has.
Check it out here - https://github.com/syntax-tree/mdast-util-to-hast/commit/58a75f4cd7088b7d669201e7cd37bb56e5a6bf0b
Maybe this issue should now be closed?
Cheers!
Most probably, we'll have to wait for the dependent libraries to upgrade to 11.1.1.
@krypticallusion Thanks for pointing that out! I just managed to patch my local library. Spent the better half of my day figuring out what's wrong. 😅
Leaving how I patched that here in case anyone stumble across the same problem and just wanted to fix this head on.
"postinstall": "patch-package"
to package.jsonnpx patch-package mdast-util-to-hast
npm install
Voilà, it should work when you build. p.s. delete node_modules/.vite if dev server doesn't work.
Closing the issue with respect to @ludwigHoon's patch above and the dependency issue being fixed in the faulty package.
Describe the bug
While trying to use react-markdown in my vite react starter template, the website crashes in production build with some vague error, the dev build of the same works fine.
Reproduction
https://github.com/krypticallusion/test/tree/vite/react-markdown for reproducing this error
Before submitting the issue, please make sure you do the following
I've already opened an issue on react-markdown in regards to this, as I originally thought this was a react-markdown thing. However... https://github.com/remarkjs/react-markdown/issues/598#issuecomment-850987858 considers this a vite thing.