nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.59k stars 2.36k forks source link

NX Cloud (19.0.0) is preventing Angular development server from starting/running properly #27708

Closed bryanw6d closed 2 months ago

bryanw6d commented 2 months ago

Current Behavior

I suspect that NX Cloud is preventing my angular application's dev server from starting and running properly. This began yesterday. I resolved it once with yarn cache clean and reinstalling deps, but it has restarted again today and the previously mentioned fix is no longer worker. When running yarn start --verbose I get the following logs:

yarn run v1.22.19
~/Code/red/[project]: yarn start --verbose                                                                                                                                                                                       08/30/2024 10:52:12 AM
yarn run v1.22.19
$ nx serve --verbose
[NX CLOUD] Using light client
[NX CLOUD] Currently installed bundle is invalid, downloading version 2408.29.11  from  https://cloud.nx.app/nx-cloud/static/client-bundle
[NX CLOUD] Using bundle path:  {
  version: '2408.29.11',
  fullPath: '/Users/[user]/Code/red/[project]/node_modules/.cache/nx/cloud/2408.29.11'
}
Was not able to require.resolve module nx/src/index from the following paths: /Users/[user]/Code/red/[project]/node_modules/nx-cloud/node_modules,/Users/[user]/Code/red/[project]/node_modules. This may be expected.
Was not able to require.resolve module nx/src/devkit-exports from the following paths: /Users/[user]/Code/red/[project]/node_modules/nx-cloud/node_modules,/Users/[user]/Code/red/[project]/node_modules. This may be expected.
Was not able to require.resolve module nx/src/devkit-exports from the following paths: /Users/[user]/Code/red/[project]/node_modules/nx-cloud/node_modules,/Users/[user]/Code/red/[project]/node_modules. This may be expected.

> nx run [project]:serve:development

✨  Done in 1.46s.

As you can see the command immediately exits. However the odd part is that on windows this terminates the session entirely, and the server does not start, but on macOS, the server starts in a background process and runs as expected, but I have to manually kill the process in order to stop it as the yarn start command exits.

Expected Behavior

The server starts and process persists in the foreground.

GitHub Repo

No response

Steps to Reproduce

  1. create an angular project for Angular 14 with NX v15 and nx-cloud version latest
  2. run yarn start

Nx Report

NX   Report complete - copy this into the issue template

   Node : 22.1.0
   OS   : darwin x64
   yarn : 1.22.19

   nx : 15.1.1
   @nrwl/angular : 15.1.1
   @nrwl/cypress : 15.1.1
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.1.1
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.1.1
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.1.1
   @nrwl/js : 15.1.1
   @nrwl/linter : 15.1.1
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 19.0.0
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 15.1.1
   @nrwl/web : Not Found
   @nrwl/webpack : 15.1.1
   @nrwl/workspace : 15.1.1
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
         @ng-bootstrap/ng-bootstrap: 13.1.1
         @storybook/angular: 6.5.16
         ngx-build-plus: 14.0.0

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

CURRENT FIX: while this issue is present, the version of nx-cloud set in package.json is latest. However, by changing this version to 15.1.1 and reinstalling deps, this resolves the issue and the server starts and runs as expected. So it seems that the latest version of nx-cloud (19.0.0) is the culprit here, but since this is 17 days since publishing the latest version at the time of writing, I'm still perplexed as to why this just started yesterday.

SergioMacGyver commented 2 months ago

We've had the same issue today. And the suggested workaround, by changing nx-cloud version in package.json, worked for us.

Thanks, @bryanw6d

StalkAltan commented 2 months ago

Hi @bryanw6d and @SergioMacGyver

You should be OK to re-upgrade to nx-cloud@latest. We released an OTA update that exposed a previously unknown issue with a few Nx OSS versions. Apologies for the inconvenience.

github-actions[bot] commented 1 month ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.