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

ReactRefresh in monorepo fails to update when more than one react-app present in the page #250

Closed
cezarneaga opened this issue Nov 10, 2020 · 7 comments · Fixed by #273
Closed

Comments

@cezarneaga
Copy link

Unfortunately it is time consuming to provide a repro repository for this but if nothing pops into mind as a fix i will do it.

in a typescript monorepo (lerna and yarn workspaces enabled) with 2 cra started simultaneous in dev mode, DOM updates do not happen as expected.

i have a index.html that loads code from both react apps (meaning it has two different root divs) so i have 2 bundles present and 2 ws monitoring updates from react-refresh.

crashes in any of the apps get the overlay to show up correctly. the apps load correctly and everything compiles correctly.

the problem is, changes do not get reflected in the browser. if i remove one of the bundles being loaded, everything is back working.

yes, everything is freshly installed. using yarn, removed node_modules and yarn lock, in root and in packages.

Environment Info:

current version of create-react-app: 4.0.0
running from /Users/.../.config/yarn/global/node_modules/create-react-app

System:
OS: macOS 10.15.7
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Binaries:
Node: 10.15.3 - /usr/local/opt/node@10/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/opt/node@10/bin/npm
Browsers:
Chrome: 86.0.4240.183
Edge: 86.0.622.63
Firefox: Not Found
Safari: 14.0
npmPackages:
react: 17.0.1
react-dom: 17.0.1
react-scripts: 4.0.0
npmGlobalPackages:
create-react-app: Not Found

Steps to reproduce

create monorepo
have index.html load 2 react-apps
start with lerna run start
change one file and wait for updates
@pmmmwh
Copy link
Owner

pmmmwh commented Nov 11, 2020

I think this is related - #239

Can you try modifying the this line to bypass the check and see if it works for both of you?

@cezarneaga
Copy link
Author

hi Michael @pmmmwh ,
it doesnt work. it works for one of them but for the other i get: Uncaught Error: Iframe has not been created yet.

@pmmmwh
Copy link
Owner

pmmmwh commented Nov 13, 2020

hi Michael @pmmmwh ,
it doesnt work. it works for one of them but for the other i get: Uncaught Error: Iframe has not been created yet.

Hmm, this actually means that it worked, it's just the overlay integration that would break because we do not check that it is only injected once at the moment.

I'll take a look.

@cezarneaga
Copy link
Author

any luck on this, Michael?

@pmmmwh
Copy link
Owner

pmmmwh commented Nov 23, 2020

Hi - yes! I am actively working on this and hope to have this cut into the next release, which should hopefully be done by next week.

@cezarneaga
Copy link
Author

this is amazing. sorry to have pinged on this. will exercise patience 🧘🏼‍♂️

@cezarneaga
Copy link
Author

Hi Michael,

Any updates here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants