Open JackTiber opened 2 years ago
Actually, looking at the file history it looks like the dependency for mkdirp
was just removed from this version but changed back to localFs.mkdirp
from localFs.mkdir
.
Ran into the same thing. Can't use the plugin with webpack-middleware-dev like this.
Actually, looking at the file history it looks like the dependency for
mkdirp
was just removed from this version but changed back tolocalFs.mkdirp
fromlocalFs.mkdir
.
Here's my main version info: node: 21.6.2 npm : 10.4.0 webpack: 5.90.3 webpack-cli: 5.1.4 webpack-dev-middleware: 7.0.0 webpack-dev-server: 5.0.2 webpack-sources: 3.2.3 assets-webpack-plugin: 7.1.1
At some point, when I upgraded to the above mentioned "npm package", I got the same error.Until then, it had been running fine.That's weird.
Personally, I think it's due to the recent "webpack" update that removed the outdated "mkdirp", see: https://webpack.js.org/blog/2020-10-10-webpack-5-release/#filesystems
Then, after I changed "mkdirp" to "mkdir" as you said, it triggered a new error.
After troubleshooting, the final change to this worked: localFs.mkdir(options.path, { recursive: true }, mkdirCallback);
This issue was created a long time ago, but I'm posting the problem I encountered and the solution for your reference.
Describe the bug On line 51 of
lib/output/createOutputWriter.js
the local variablelocalFs
is either filestream or the fs module from Node, but on line 88 the methodlocalFs.mkdirp
is called to output the json file. The resulting error during a build is below.Changing this to
localFs.mkdir
seems to fix the issue.To Reproduce Steps to reproduce the behavior:
options.keepInMemory
totrue
Expected behavior For the JSON file to be output correctly in memory.
Webpack Config
Desktop (please complete the following information):
Additional context Add any other context about the problem here.