mdx-js / mdx

Markdown for the component era
https://mdxjs.com
MIT License
17.76k stars 1.14k forks source link

`@mdx-js/rollup` stops working on Vite v5 #2413

Closed JounQin closed 11 months ago

JounQin commented 11 months ago

Initial checklist

Affected packages and versions

@mdx-js/rollup

Link to runnable example

https://github.com/un-ts/mono-lib-boilerplate

Steps to reproduce

yarn
yarn dev

Expected behavior

Render page correctly

Actual behavior

image

Runtime

Node v18

Package manager

yarn v4

OS

macOS

Build and bundle tools

Vite

ChristianMurphy commented 11 months ago

@JounQin sorry you ran into a spot of trouble. Could you produce a minimal reproducible example?

It works in my testing https://stackblitz.com/edit/vitejs-vite-4txvc5?file=package.json

JounQin commented 11 months ago

@ChristianMurphy Did you try my linked https://github.com/un-ts/mono-lib-boilerplate?

ChristianMurphy commented 11 months ago

@JounQin have you tried reducing the issue? Or using an official release of vite instead of a patched version? I'm at a conference right now, but if you're stuck I may be able to help you debug your personal project later.

JounQin commented 11 months ago

@ChristianMurphy The reproduction is tiny.

image

The patch is also tiny for https://github.com/vitejs/vite/issues/15281

image

I do cannot reproduce on stackblitz: https://stackblitz.com/edit/vitejs-vite-mt6zzg?file=vite.config.ts,src%2Fmain.tsx

I'm still trying to add react-router-dom.

wooorm commented 11 months ago

Which repo do you mean? I see a link to https://github.com/un-ts/mono-lib-boilerplate which is giant?

wooorm commented 11 months ago

From the Vite issue and your patch, it seems a Vite bug?

JounQin commented 11 months ago

Which repo do you mean? I see a link to un-ts/mono-lib-boilerplate which is giant?

The vite part is only docs folder. Maybe really a Vite bug which does not support nested folder anymore, I'll find out later.

JounQin commented 11 months ago

I really can't find out what is going on... I changed almost everything on stackblitz just like my mono-lib-boilerplate, but it just works differently...

@ChristianMurphy If you can help to debug when you're free that would be very appreciated.

ChristianMurphy commented 11 months ago

@JounQin have you tried installing via npm instead of yarn? My next thought is that resolutions and how the folders are laid out are different between the two.

JounQin commented 11 months ago

@JounQin have you tried installing via npm instead of yarn? My next thought is that resolutions and how the folders are laid out are different between the two.

Just tried, it didn't help.

ChristianMurphy commented 11 months ago

@JounQin I see some more changes landed in un-ts/mono-lib-boilerplate are you still having a vite issue? or has it been resolved?

JounQin commented 11 months ago

Thanks for still remembering this issue, it is indeed an issue from Vite itself.

JounQin commented 11 months ago

See also https://github.com/vitejs/vite/pull/15286

shahbaz-khan-hub commented 1 month ago

i am also having issue md/mdx vite plugin there is version compatablilty issue , did any one solved it yet how to tackle

wooorm commented 1 month ago

It’s probably not related. This was an external issue that was raised and solved 10 months ago.

To debug your problems, we need a lot of info. Please open new discussions for your specific problems and provide a lot of info. See https://mdxjs.com/community/support/