nrwl / nx

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

App Serve not working after migrating to NX 19 #23320

Closed pikilon closed 6 months ago

pikilon commented 6 months ago

Current Behavior

Expected Behavior

GitHub Repo

No response

Steps to Reproduce

  1. App is served with NX 18.3 using a React SPA and rsPack
  2. executed: npx nx migrate latest && npx nx migrate --run-migrations
  3. yarn start stopped working

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.10.0
OS     : linux-x64
yarn   : 1.22.21

nx                 : 19.0.2
@nx/js             : 19.0.2
@nx/jest           : 19.0.2
@nx/linter         : 19.0.2
@nx/eslint         : 19.0.2
@nx/workspace      : 19.0.2
@nx/cypress        : 19.0.2
@nx/devkit         : 19.0.2
@nx/esbuild        : 19.0.2
@nx/eslint-plugin  : 19.0.2
@nx/node           : 19.0.2
@nx/react          : 19.0.2
@nx/storybook      : 19.0.2
@nrwl/tao          : 19.0.2
@nx/web            : 19.0.2
@nx/webpack        : 19.0.2
typescript         : 5.4.5
---------------------------------------
Community plugins:
@nx/rspack             : 18.0.6
@simondotm/nx-firebase : 2.3.0
nx-stylelint           : 15.0.0

Failure Logs

yarn run v1.22.21
$ nx serve --verbose
[NX CLOUD] Verifying current cloud bundle
[NX CLOUD] A local bundle currently exists:  {
  version: '2405.02.15.hotfix3',
  fullPath: '/absolute_route/.nx/cache/cloud/2405.02.15.hotfix3'
}
[NX CLOUD] Last verification was within the past 30 minutes, will not verify this time
[NX CLOUD] Done:  /absolute_route/.nx/cache/cloud/2405.02.15.hotfix3

> nx run frontend:serve:development

[Nx Cloud] Unable to detect a VCS context from the environment.

 NX   RunStart

{
  "meta": {},
  "branch": null,
  "runGroup": "73f1bab62c2d3440af5a0fa603533cc57d3c77a6",
  "ciExecutionId": null,
  "ciExecutionEnv": "",
  "hashes": [
    "3766499325879080432"
  ],
  "machineInfo": {
    "machineId": "wuctWghxqpB3100w1PGK7g==",
    "platform": "linux",
    "version": "#1 SMP Thu Oct 5 21:02:42 UTC 2023",
    "cpuCores": 12
  },
  "vcsContext": null
}

RunStart duration: 372
 NX   Workspaces is not a constructor
TypeError: Workspaces is not a constructor
    at readTargetOptions (/absolute_route/node_modules/@nx/rspack/node_modules/@nx/devkit/src/executors/read-target-options.js:26:16)
    at runExecutor_1 (/absolute_route/node_modules/@nx/rspack/src/executors/dev-server/dev-server.impl.js:22:61)
    at runExecutor_1.next (<anonymous>)
    at resume (/absolute_route/node_modules/tslib/tslib.js:281:48)
    at /absolute_route/node_modules/tslib/tslib.js:280:125
    at new Promise (<anonymous>)
    at i.<computed> [as next] (/absolute_route/node_modules/tslib/tslib.js:280:67)
    at getLastValueFromAsyncIterableIterator (/absolute_route/node_modules/nx/src/utils/async-iterator.js:15:34)
    at iteratorToProcessStatusCode (/absolute_route/node_modules/nx/src/command-line/run/run.js:43:94)
    at /absolute_route/node_modules/nx/src/command-line/run/run.js:179:16

 NX   Running target serve for project frontend failed

Failed tasks:

- frontend:serve:development

Hint: run the command with --verbose for more details.

View structured, searchable error logs at https://nx.app/runs/GpsxAhE4sG

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Package Manager Version

yarn run v1.22.21

Operating System

Additional Information

I have no .env files, I clarified this because the only breaking change allegedly in nx 19 was about them. I tried using npm but it also doesn't work

pikilon commented 6 months ago

This is a problem of @nx/rspack that the latest version is 18.3.7 and even the demo project gives this problem Reproduce:

Coly010 commented 6 months ago

Linked PR: https://github.com/nrwl/nx-labs/pull/399

Coly010 commented 6 months ago

Fixed by above PR and subsequent release made: https://www.npmjs.com/package/@nx/rspack

pikilon commented 5 months ago

It is not fixed by the latest version 19 of @nx/rspack

parth-anblicks commented 5 months ago

I also faced a similar issue with latest version of @nx/rspack.

github-actions[bot] commented 4 months 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.