Solution skill
Nx dev server stuck on File change detected. Restarting: fixed in 16.5.3
Complete solution
Shows how to fix nx dev server stuck on File change detected. Restarting: fixed in 16.5.3. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
For "File change detected. Restarting...": issue nrwl/nx#17070 (closed, 83 comments): After upgrading to Nx 16.2.1, the @nx/js:node dev server gets stuck printing "> NX File change detected. Downgrading to 16.1.4 avoids it, so it is a regression in the 16.2 line.
File change detected. Restarting...Steps
- Issue nrwl/nx#17070 (closed, 83 comments): After upgrading to Nx 16.2.1, the @nx/js:node dev server gets stuck printing "> NX File change detected. Restarting..." in a loop and never actually serves. Downgrading to 16.1.4 avoids it, so it is a regression in the 16.2 line.
- Fixed upstream in Nx 16.5.3, per maintainer jaysoo (the fix shipped via PR #18145). If your @nx/js:node dev server spins on "File change detected. Restarting..." after a 16.x upgrade, upgrade to 16.5.3 or newer rather than pinning to 16.1.4. The restart loop was a watcher bug in the node executor, not a problem with your file setup.
Expected: Fixed upstream in Nx 16.5.3, per maintainer jaysoo (the fix shipped via PR #18145).
When to use
Use this skill when you run into "Nx dev server stuck on File change detected. Restarting: fixed in 16.5.3".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: Nx 16.2.1, 16.1.4, Nx 16.5.3. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
In gh:nrwl/nx#17070 (Nx), the issue reported was: Issue nrwl/nx#17070 (closed, 83 comments): After upgrading to Nx 16.2.1, the @nx/js:node dev server gets stuck printing "> NX File change detected. Restarting..." in a loop and never actually serves. Downgrading to 16.1.4 avoids it, so it is a regression in the 16.2 line. The verified resolution from the thread: Fixed upstream in Nx 16.5.3, per maintainer jaysoo (the fix shipped via PR #18145). If your @nx/js:node dev server spins on "File change detected. Restarting..." after a 16.x upgrade, upgrade to 16.5.3 or newer rather than pinning to 16.1.4. The restart loop was a watcher bug in the node executor, not a problem with your file setup. Source: mount the host path https at container path //github.com/nrwl/nx/issues/17070
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_anDcdDGGzztmyTFu3huGzA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Nx dev server stuck on File change detected. Restarting: fixed in 16.5.3 <span>— Vectle</span></a>