Conversation
commit: |
|
out of curiosity. Why different paths for react ? |
gioboa
left a comment
There was a problem hiding this comment.
The PR is not working, in fact tests are failing. With react 18 mix dev and prod is not a problem but with React 19 is not working anymore. 😞 I spent 2 days on this issue and it's still not working
|
@gioboa I struggled for a long time with mixing dev and prod React 19 apps. The error I kept encountering was “dispatcher.getOwner is not a function”. I imagine there are others as well The only solution I came up with is to switch React to production mode using the Vite plugin for the dev server when mixing dev and prod builds Plus, add all React dependencies to shared, such as: It's actually a bad solution, since it completely breaks HMR, but at least it works to some extent. I hope this helps in some way... |
|
I also tried replacing the shared React instance with the dev version using a runtime plugin, but it still breaks after the build. Getting Vite to build the dev version alongside the prod version is quite a challenge; I did this using esbuild with a separate Node script. This is probably a more promising approach—you could try using a proxy to build both versions and switch between them based on some specific criteria. |
There was a problem hiding this comment.
@alternativniy I started again from a clean main code and with this simple changes the vite-vite example is working with host dev and remote prod.
|
@gioboa It’s expected that everything will work correctly with the host dev. In practice, however, the opposite is usually required host prod and remote dev. For example, we need this so that each remote’s dev server can be launched separately and operate independently of the host. |
my latest commit supported both mixed scenarios. |
| '\u2029': '\\u2029', | ||
| }; | ||
|
|
||
| function escapeUnsafeJsSourceChars(str: string): string { |
There was a problem hiding this comment.
Just started to read code.. still piecing things together... react 19 src must have some of these chars?
There was a problem hiding this comment.
Seems like a code comment would go a long ways here
There was a problem hiding this comment.
Cleaning up old browser tabs... curious what this change was about
|
One question I have: Why did react think we're in a testing environment?? |
| "preview": "vite build && vite preview" | ||
| "preview": "vite build && vite preview", | ||
| "mixed:1": "vite build && vite preview", | ||
| "mixed:2": "MIXED_VV=2 NODE_ENV=production vite" |
There was a problem hiding this comment.
We need to set production to serve the correct bundle.

Close #476