Cannot read properties of undefined (reading 'removeAvailableModules') when using Rspack in dev mode #31268
Open
1 of 4 tasks
Labels
priority: medium
Medium Priority (not high, not low priority)
scope: bundlers
Issues related to webpack, rollup
type: bug
Uh oh!
There was an error while loading. Please reload this page.
Current Behavior
Running
nx build <project> --configuration=development
with @nx/rspack causes this error:TypeError: Cannot read properties of undefined (reading 'removeAvailableModules')
Expected Behavior
The development build should succeed using Rspack with default settings, even if the "optimization" field is omitted from the dev config.
GitHub Repo
https://github.com/CuriousSyrup/nx-rspack-dev-bug
Steps to Reproduce
Create workspace
npx create-nx-workspace nx-node-lib-rspack
cd nx-node-lib-rspack
Add node + rspack plugins
npx nx add @nx/node
npx nx g @nx/node:lib libs/node-lib --useProjectJson
npx nx add @nx/rspack
Create libs/node-lib/rspack.config.js with:
nx build node-lib --configuration=production
# ✅ worksnx build node-lib --configuration=development
# ❌ crashesNx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: