vitejs / vite-plugin-react-swc

Speed up your Vite dev server with SWC
MIT License
778 stars 50 forks source link

[vite] internal server error: buildings not found in WebContainers #118

Closed FossPrime closed 1 year ago

FossPrime commented 1 year ago

Pr workaround got merged... https://github.com/kat-tax/vslite/pull/14

It would be great if upstream handled this for us. Ehum.

ArnaudBarre commented 1 year ago

I'm not sure what you expect this package to do? Always download the babel version just in case you're running in web containers?

I think the long term fix is environment using a wasm build of SWC instead so that you can have the same behaviour (what Stackblitz does for esbuild I think).

For me this is not an issue. Babel is well more suited for demo/sandbox environment.

FossPrime commented 1 year ago

Or how about doing an async import of the JS plugin?

That way if the user has it in his dependencies, it will just work without userland changes.

I would rather this had it as a devDependency... those are full of junk all the time... this would actually be helpful.

ArnaudBarre commented 1 year ago

This will be very rare than the babel plugin is also installed. And then I have to be sure the options are compatible.

I think fixing it at the template level or in the repo for people using hybrid environnement is totally fine and doesn't sound like a hack that should be included in this plugin, juts a requirement (working in container environment) that is out of scope of this plugin for now

FossPrime commented 1 year ago

This will be very rare than the babel plugin is also installed. And then I have to be sure the options are compatible.

I think fixing it at the template level or in the repo for people using hybrid environnement is totally fine and doesn't sound like a hack that should be included in this plugin, juts a requirement (working in container environment) that is out of scope of this plugin for now

Providing a less arcane error message would also be extremely helpful. Perhaps one with a link to the workaround.

ArnaudBarre commented 1 year ago

Yeah something that I can do