react-nodegui icon indicating copy to clipboard operation
react-nodegui copied to clipboard

hot reloading not working?

Open ghost opened this issue 3 years ago • 9 comments

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 avatar Aug 05 '21 09:08 ghost

Doesn't work for me too on Xubuntu Focal.

ghost avatar Oct 27 '21 06:10 ghost

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.

ZaLiTHkA avatar Jan 11 '22 20:01 ZaLiTHkA

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.

Hydrair avatar Jan 14 '22 23:01 Hydrair

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.

ZaLiTHkA avatar Jan 19 '22 22:01 ZaLiTHkA

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

ghost avatar Jan 20 '22 07:01 ghost

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 avatar Jan 21 '22 06:01 ZaLiTHkA

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.

ZaLiTHkA avatar Jan 21 '22 07:01 ZaLiTHkA

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.

Sledmine avatar Feb 14 '22 03:02 Sledmine

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.

pseudoramble avatar Mar 04 '22 16:03 pseudoramble