Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run React with vite from the example #3326

Open
AshwinPetari opened this issue Nov 11, 2023 · 8 comments
Open

Not able to run React with vite from the example #3326

AshwinPetari opened this issue Nov 11, 2023 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@AshwinPetari
Copy link

AshwinPetari commented Nov 11, 2023

Im trying to see if Vite can work with React as I saw there are some issues for module federation for React. I'm not sure what is wrong, but when I clone this repo and run this locally with the commands mentioned, it throws the following error and doesn't load anything.

image

Even with this other repo, it throws the following error. It leads me to believe one of the dependencies might have broken

image
@ScriptedAlchemy
Copy link
Member

try enabling CORS, looks like a cors issue potentially, also check its using right react version which has createRoot

@AshwinPetari
Copy link
Author

Vite by default have all origins enabled and using browser based extensions throw the same error. Requesting to reopen this ticket and actually run this locally to reproduce the error.

image

@ScriptedAlchemy ScriptedAlchemy added the help wanted Extra attention is needed label Nov 18, 2023
@ScriptedAlchemy
Copy link
Member

Ive fixed the example partially, but there are still some issues on the webpack side, i think it needs html webpack plugin if you want to send a pr adding it.

@AshwinPetari
Copy link
Author

Let me try it out

@ScriptedAlchemy
Copy link
Member

Send pr if you make any progress, its likely missing html webpack plugin setup - it loos like some new version removes some presets that used to exist there.

@danielm2402
Copy link

I cloned this example and am getting the same issue. How could I solve it? Could you post a PR if you show me the problem.

@nahimr
Copy link

nahimr commented Apr 16, 2024

Any progress on this issue ?

@bharatwaj
Copy link

I am running into the same issue with example vite-react-microfrontends. react-dom and react are getting downloaded as expected but it is not getting set as expected.

createRoot-error

@ScriptedAlchemy Any thoughts? Could you please clarify on your comment wrt html webpack plugin. This example does not use webpack plugin right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants