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

hot reloading not working? #354

Open
ghost opened this issue Aug 5, 2021 · 9 comments
Open

hot reloading not working? #354

ghost opened this issue Aug 5, 2021 · 9 comments

Comments

@ghost
Copy link

ghost commented Aug 5, 2021

Describe the bug
well.. hot reload doesnt work

To Reproduce
Steps to reproduce the behavior:

  1. get latest react-nodegui-starter
  2. run yarn (or npm) run dev
  3. also run yarn (or npm) run start
  4. try to change code
  5. wont change

Expected behavior
it should change the behavior/look of the window

Screenshots
well i have no idea how to describe it in images

Desktop (please complete the following information):

  • OS: Linux
  • NodeGUI version: 0.35.0
  • React NodeGUI version: 0.10.2
  • OS Version: Fedora 34

Additional context
nope

@ghost
Copy link

ghost commented Oct 27, 2021

Doesn't work for me too on Xubuntu Focal.

@ZaLiTHkA
Copy link

ZaLiTHkA commented Jan 11, 2022

same here, affects both Windows 10 and Pop!_OS 21.10 for me, with Node 14 and 16..

feedback in the terminal shows the project rebuilding, but the rendered window simply doesn't "refresh".

edit: FWIW, I did try with the root App component as a React Class as per #349, but that did not seem to make any difference.

edit 2: got it working on Linux, somehow.. see additional comment below.

@Hydrair
Copy link

Hydrair commented Jan 14, 2022

edit: FWIW, I did try with the root App component as a React Class as per #349, but that did not seem to make any difference.

Can confirm, no hot reloading on Pop OS 21.10, followed the Getting started section.

@ZaLiTHkA
Copy link

ZaLiTHkA commented Jan 19, 2022

so, after messing around trying to get Volta working, I just got the current nodegui/react-nodegui-starter project up and running (with NVM, not Volta.. scratch that, it runs with Node from either one..) and hot reload is working.. 🤔

my current project was created from this commit, and my environment has the following:

 ~/workspace/sandbox/react-nodegui-tester  master !3 ?1                                                                                                                                                                                 
❯ node -v
v16.13.2

 ~/workspace/sandbox/react-nodegui-tester  master !3 ?1                                                                                                                                                                                 
❯ npm -v
8.1.2

 ~/workspace/sandbox/react-nodegui-tester  master !3 ?1                                                                                                                                                                                 
❯ npm ls -g
/home/dre/.nvm/versions/node/v16.13.2/lib
├── @angular/[email protected]
├── @aws-amplify/[email protected]
├── @nrwl/[email protected]
├── [email protected]
├── [email protected]
└── [email protected]

hmmm... I'll try again on Windows soon.

@ghost
Copy link
Author

ghost commented Jan 20, 2022

well I am using yarn, that might be the issue?

@ZaLiTHkA
Copy link

hmmm... I'll try again on Windows soon.

trying this again on my Windows 10 PC this morning, I now have hot reload working.. same Node and NPM versions, cloned react-nodegui-starter from the same commit (current HEAD, fwiw), launched npm run dev and npm start, and changes to src/app.tsx are reflected in the running app almost instantly.

so, VSCode "Package Json Upgrade" shows a bunch of newer versions available for virtually all of the starter project's deps, but package-lock.json does cause the listed versions to be installed (confirmed with npm ls --depth=0, all versions match package.json exactly).

at this point, since the starter references @types/node@^14.11.1, I decided to flip over to Node 14 (Volta picked 14.18.3). running npm install ran just fine, the cmake-js compile post-install command completed with no errors (Minimal Qt 5.14.1), and again, hot reload is still working.


I'm very confused now, why was it broken and now it's not? what changed? react-nodegui-starter hasn't in ages, and specifically it's package.json hasn't changed in almost a year..

@ZaLiTHkA
Copy link

ah, I think I've got something.. I was just running through this with the newer versions of @nodegui/react-nodegui, while leaving all other deps alone.

both 0.11.0 and 0.12.0 are good, with hot reload working as expected. but then I run into issues trying to install 0.13.0. it seems the upgrade from 0.12.0 to 0.13.0 changed the following relevant points:

  • (dep) @nodegui/nodegui from ^0.30.2 to 0.36.0 (which is still very old, latest is 0.45.4)
    • can't see any breaking changes, though 0.36.0 itself does also [upgrade qode to 16.4.0, which also upgrades Node to the same version..
  • (peer) react from ^16.9.0 to ^17.0.2
    • no breaking changes listed for 17.x, but...
  • (dev) react stayed at ^16.13.1
    • ...is there any reason that this wasn't also bumped up to 17.x?
  • (dev) typescript from ^3.9.7 to 4.3.5
    • a "major" version bump in a non-SemVer compliant library..? this must change a whole ton of things. to be honest, I get a little bewildered trying to look for "potential breaking changes" in Microsoft's changelogs... 🤦🏼‍♂️

alrighty.. I'm going to stop with my testing here, because this is starting to look like there are dependency update issues. also, because I'm actually at work and I need to focus on other things now. 😁

I'll look at re-creating the starter project from scratch with the latest (compatible?) dependency versions when I get home this evening. so unless someone else beats me to it, I'll post my findings after that.

@Sledmine
Copy link

Sledmine commented Feb 14, 2022

Same here, does not work in Pop OS 20.4 using Yarn, fresh install, no hot reloading at saving files, I want to take a look too and contribute with a possible fix, but until that, hopefully someone can take a look at this faster than me.

@pseudoramble
Copy link

I also cloned the starter project, and then used yarn (1.x series) to set things up and noticed hot reloading wasn't working. So I redid the setup using npm (8.3.1) and it seems to work fine with that configuration. I'm not really sure why that would matter, but it does seem to. I'm guessing it's because it's not respecting the package lock file and a newer dependency has an issue of some sort.

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

No branches or pull requests

4 participants