case-sensitive-paths-webpack-plugin
case-sensitive-paths-webpack-plugin copied to clipboard
Webpack v5 support
This plugin appears to break with Webpack 5, are there any plans to support the new version?
Can you describe the issue you're seeing? Are you on the latest version of the plugin?
Some changes were made for Webpack 5 over a year ago, but if something's changed since then, I can fix that. I haven't switched to Webpack 5 yet on the projects I'm currently working on.
I started seeing this error in my build, I wonder if this is the error OP is seeing too?
when use webpack5+: Error: module property was removed from Dependency (use compilation.moduleGraph.updateModule(dependency, module) instead)
Facing the same issue when using Storybook with webpack5 and reactOptions.fastRefresh: true:
my-lib: <s> [webpack.Progress] 10% building 0/1 entries 0/0 dependencies 0/0 modules
my-lib: (node:20345) [DEP_WEBPACK_MAIN_TEMPLATE_OUTPUT_OPTIONS] DeprecationWarning: MainTemplate.outputOptions is deprecated (use Compilation.outputOptions instead)
my-lib: (Use `node --trace-deprecation ...` to show where the warning was created)
my-lib: (node:20345) [DEP_WEBPACK_MAIN_TEMPLATE_REQUIRE] DeprecationWarning: MainTemplate.hooks.require is deprecated (use JavascriptModulesPlugin.getCompilationHooks().renderRequire instead)
my-lib: (node:20345) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
my-lib: Documents/app/node_modules/@storybook/builder-webpack5/node_modules/webpack/lib/NormalModuleFactory.js:294
my-lib: throw new Error(
my-lib: ^
my-lib: Error: NormalModuleFactory.afterResolve (CaseSensitivePathsPlugin, ReactRefreshPlugin) is no longer a waterfall hook, but a bailing hook instead. Do not return the passed object, but modify it instead. Returning false will ignore the request and results in no module created.
my-lib: at Documents/app/node_modules/@storybook/builder-webpack5/node_modules/webpack/lib/NormalModuleFactory.js:294:14
my-lib: at _next0 (eval at create (Documents/app/node_modules/@storybook/builder-webpack5/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:17:1)
my-lib: at eval (eval at create (Documents/app/node_modules/@storybook/builder-webpack5/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:33:1)
my-lib: at Documents/app/node_modules/case-sensitive-paths-webpack-plugin/index.js:176:9
my-lib: at Documents/app/node_modules/case-sensitive-paths-webpack-plugin/index.js:125:7
my-lib: at Documents/app/node_modules/case-sensitive-paths-webpack-plugin/index.js:125:7
my-lib: at Documents/app/node_modules/case-sensitive-paths-webpack-plugin/index.js:125:7
my-lib: at Documents/app/node_modules/case-sensitive-paths-webpack-plugin/index.js:125:7
my-lib: at Documents/app/node_modules/case-sensitive-paths-webpack-plugin/index.js:125:7
my-lib: at CaseSensitivePathsPlugin.fileExistsWithCase (Documents/app/node_modules/case-sensitive-paths-webpack-plugin/index.js:95:5)
my-lib: at Documents/app/node_modules/case-sensitive-paths-webpack-plugin/index.js:118:10
my-lib: at Array.<anonymous> (Documents/app/node_modules/case-sensitive-paths-webpack-plugin/index.js:72:5)
my-lib: at runCallbacks (Documents/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:27:15)
my-lib: at Documents/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:200:4
my-lib: at go$readdir$cb (Documents/app/node_modules/graceful-fs/graceful-fs.js:195:14)
my-lib: at FSReqCallback.oncomplete (fs.js:180:23)
my-lib: error Command failed with exit code 1.
my-lib: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
my-lib: (node:20350) UnhandledPromiseRejectionWarning: RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 20350.
my-lib: at Documents/app/node_modules/@storybook/builder-webpack5/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47
my-lib: at processTicksAndRejections (internal/process/task_queues.js:81:21)
my-lib: (Use `node --trace-warnings ...` to show where the warning was created)
my-lib: (node:20350) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
my-lib: (node:20350) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.