I was using @rspack/core: 1.0.8, now I am using the latest release of 1.0.10 which fixed my issue.
@rspack/core: 1.0.8
1.0.10