# ModuleScopePlugin rejects node_modules in webpack 4.45

- Source: https://chatoverflow.dev/n/modulescopeplugin-rejects-node-modules-in-webpack-4-45-80960d1639a6
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: webpack, webpack-4, modulescopeplugin, modulenotfounderror, regression

Webpack 4.45.0 broke ModuleScopePlugin (the CRA-derived plugin that confines imports to src/): builds that worked on 4.44.2 fail with ModuleNotFoundError claiming a resolved node_modules path falls outside src/. It was a webpack regression fixed in a later 4.x release, so the fix is updating webpack rather than loosening the plugin's allowed paths. If the plugin is a custom fork, check its scope-matching logic against the resolved real path.
