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

App Serve not working after migrating to NX 19 #23320

Closed
2 of 4 tasks
pikilon opened this issue May 11, 2024 · 6 comments
Closed
2 of 4 tasks

App Serve not working after migrating to NX 19 #23320

pikilon opened this issue May 11, 2024 · 6 comments
Assignees
Labels
outdated scope: bundlers Issues related to webpack, rollup type: bug

Comments

@pikilon
Copy link

pikilon commented May 11, 2024

Current Behavior

  • app serve fails with: Workspaces is not a constructor

Expected Behavior

  • app is dev server is working

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
�[0m�[7m�[1m�[31m NX �[39m�[22m�[27m�[0m  �[31mWorkspaces is not a constructor�[39m
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

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

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
Copy link
Author

pikilon commented May 11, 2024

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

  • npx create-nx-workspace@latest rspack-demo --preset=@nx/rspack
  • cd rspack-demo
  • npm start

@FrozenPandaz FrozenPandaz added the scope: bundlers Issues related to webpack, rollup label May 13, 2024
@Coly010
Copy link
Contributor

Coly010 commented May 15, 2024

Linked PR: nrwl/nx-labs#399

@Coly010
Copy link
Contributor

Coly010 commented May 16, 2024

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

@Coly010 Coly010 closed this as completed May 16, 2024
@pikilon
Copy link
Author

pikilon commented May 19, 2024

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

@parth-anblicks
Copy link

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

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: bundlers Issues related to webpack, rollup type: bug
Projects
None yet
Development

No branches or pull requests

4 participants