vite icon indicating copy to clipboard operation
vite copied to clipboard

Rspack Host -> Vite Remote

Open swalker326 opened this issue 1 year ago • 9 comments

I'm trying to create a pnpm workspace with an

  • rspack host
  • vite remote

Both using react, is this possible and if so are there any examples so I can try to figure out what I'm doing wrong. Thanks!

swalker326 avatar Oct 23 '24 02:10 swalker326

Hi, can you share your repo please?

gioboa avatar Oct 23 '24 03:10 gioboa

https://github.com/swalker326/mf-rspack-vite-interop

swalker326 avatar Oct 23 '24 03:10 swalker326

I don't have expertise with Rspack but our example looks similar to yours

Clone the repo

pnpm install
pnpm run build
pnpm run preview-vv

You need to refresh the host because the compilation has a race condition

gioboa avatar Oct 23 '24 04:10 gioboa

I'm not sure how, but my brain just skipped that example, sorry about that.

swalker326 avatar Oct 23 '24 09:10 swalker326

No problem, would you like to add a rspack host example in the repo?

gioboa avatar Oct 23 '24 10:10 gioboa

Yea, once I get it working I can, okay to rename the rust-vite to rsbuild-vite then add rspack-vite?

swalker326 avatar Oct 23 '24 11:10 swalker326

I think i'm close, have you run into this issue?

From the rspack host app: image

Adding the actual error message so its searchable:

@vitejs/plugin-react can't detect preamble. Something is wrong.

swalker326 avatar Oct 23 '24 11:10 swalker326

No, I never saw that error message

gioboa avatar Oct 23 '24 12:10 gioboa

https://github.com/module-federation/vite/issues/65

close react hmr

zhangHongEn avatar Oct 29 '24 03:10 zhangHongEn

As there's been no activity for 30 days, this issue has been flagged as stale. If you'd like it to remain open, please add a comment within the next 7 days. Thank you.

github-actions[bot] avatar Nov 05 '25 16:11 github-actions[bot]