Skip to content

Cannot Create Angular Project with rspack #30747

@KerickHowlett

Description

@KerickHowlett

Current Behavior

When I attempt to create a Nx workspace using the Angular stack with rspack as the bundler, I encounter a fatal error error when it attempts to generate a GitHub Actions workflow:

It gives me the same error using pnpm, and it continues to do this even without generating a CI workflow, with Nx Console to throw the same error.

I also encounter a similar error using yarn create nx-workspace about not being able to find the @angular/build/private module.

It seems to work fine when using npx.

Expected Behavior

It should generate a Nx workspace to support an Angular stack with rspack as the bundler without any fatal errors.

GitHub Repo

No response

Steps to Reproduce

Just enter the create-nx-workspace command with the following options when prompted:

❯ bunx -y create-nx-workspace@latest                                                                                                 

 NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Where would you like to create your workspace? · throwaway
✔ Which stack do you want to use? · angular
✔ Integrated monorepo, or standalone project? · integrated
✔ Application name · throwaway
✔ Which bundler would you like to use? · rspack
✔ Default stylesheet format · css
✔ Do you want to enable Server-Side Rendering (SSR)? · No
✔ Which unit test runner would you like to use? · vitest
✔ Test runner to use for end to end (E2E) tests · playwright
✔ Which CI provider would you like to use? · github

Nx Report

Unable to produce a report on account of this issue pertaining to the generation of a new Nx workspace.

Failure Logs

The error log when running the command using `bun` or `pnpm`.

❯ cat ~/Projects/playgrounds/throwaway/error.log                                                                      ─╯
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: ~/Projects/playgrounds/throwaway/error.log
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ 
   2   │  NX   Failed to process project graph.
   3   │ 
   4   │ An error occurred while processing files for the @nx/rspack/plugin plugin (Defined at nx.json#plugins[4])
   5   │ .
   6   │   - apps/throwaway/rspack.config.ts: Package subpath './src/tools/esbuild/angular/component-stylesheets' is not defined by "expo
       │ rts" in /home/kingofheroes/Projects/playgrounds/throwaway/node_modules/@nx/angular-rspack-compiler/node_modules/@angular/build/p
       │ ackage.json
   7   │ 
   8   │ 
   9   │ (node:3939182) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
  10   │ (Use `node --trace-deprecation ...` to show where the warning was created)
  11   │ (node:3939187) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
  12   │ (Use `node --trace-deprecation ...` to show where the warning was created)
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

The error when using `yarn`.

❯ cat /home/kingofheroes/Projects/playgrounds/throwaway/error.log                                                                      ─╯
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /home/kingofheroes/Projects/playgrounds/throwaway/error.log
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ 
   2   │  NX   Failed to process project graph.
   3   │ 
   4   │ An error occurred while processing files for the @nx/vite/plugin plugin (Defined at nx.json#plugins[2])
   5   │ .
   6   │   - apps/throwaway/vite.config.mts: Cannot find module '@angular/build/private'
   7   │ Require stack:
   8   │ - /home/kingofheroes/Projects/playgrounds/throwaway/node_modules/@analogjs/vite-plugin-angular/src/lib/utils/devkit.js
   9   │ Require stack:
  10   │ - /home/kingofheroes/Projects/playgrounds/throwaway/node_modules/@analogjs/vite-plugin-angular/src/lib/utils/devkit.js
  11   │ 
  12   │ 
  13   │ failed to load config from /home/kingofheroes/Projects/playgrounds/throwaway/apps/throwaway/vite.config.mts
  14   │ The following options are not yet supported:
  15   │   "budgets"
  16   │ 
  17   │ (node:3966588) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
  18   │ (Use `node --trace-deprecation ...` to show where the warning was created)
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Package Manager Version

bun: 1.2.5 | pnpm: 10.8.0 | yarn: 4.9.0 | npm: 11.2.0

Operating System

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

Additional Information

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions