Skip to content

[Bug]: CircularDependencyRspackPlugin should print module name instead of identifier #10378

Closed
@colinaaa

Description

@colinaaa
Collaborator

System Info

System:
OS: macOS 14.6.1
CPU: (12) arm64 Apple M2 Max
Memory: 11.48 GB / 96.00 GB
Shell: 4.0.0 - /opt/homebrew/bin/fish
Binaries:
Node: 23.8.0 - ~/.local/state/fnm_multishells/54394_1747290047720/bin/node
npm: 10.9.2 - ~/.local/state/fnm_multishells/54394_1747290047720/bin/npm
pnpm: 9.15.2 - ~/.local/state/fnm_multishells/54394_1747290047720/bin/pnpm
bun: 1.2.8 - ~/.bun/bin/bun
Browsers:
Chrome: 136.0.7103.113
Safari: 17.6
npmPackages:
@rspack/cli: ^1.3.10 => 1.3.10
@rspack/core: ^1.3.10 => 1.3.10

Details

Currently, the error produced by CircularDependencyRspackPlugin contains too much unused information like the loaders and the layer of the module, which is hard to read.

ERROR in × Circular dependency detected:
  │  javascript/auto|/echo-loader.js!/src/foo.js|main -> javascript/auto|/echo-loader.js!/src/bar.js|main -> javascript/auto|/echo-loader.js!/src/foo.js|main


Rspack compiled with 1 error in 50 ms

This is the error that circular-dependency-plugin print with Webpack:

ERROR in Circular dependency detected:
src/bar.js -> src/foo.js -> src/bar.js

ERROR in Circular dependency detected:
src/foo.js -> src/bar.js -> src/foo.js

webpack 5.97.1 compiled with 2 errors in 39 ms

Reproduce link

https://github.com/colinaaa-reproductions/rspack-repro-circular-module-identifier

Reproduce Steps

  1. pnpm install
  2. pnpm run build:rspack to see CircularDependencyRspackPlugin error
  3. pnpm run build:webpack to see circular-dependency-plugin error

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @colinaaa

    Issue actions

      [Bug]: CircularDependencyRspackPlugin should print module name instead of identifier · Issue #10378 · web-infra-dev/rspack