HookWebpackError: ENOENT: no such file or directory, scandir
See original GitHub issueDescription After update to angular v12, get the error HookWebpackError: ENOENT: no such file or directory, scandir
Expected behavior
The plugin should be generating an output file in the build dist
directory as it did with the previous version of angular v11.
Actual behavior
[error] HookWebpackError: ENOENT: no such file or directory, scandir
at makeWebpackError (~/scheduler/node_modules/webpack/lib/HookWebpackError.js:49:9)
at ~/scheduler/node_modules/webpack/lib/Compilation.js:2496:12
at eval (eval at create (~/scheduler/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:29:1)
at fn (~/scheduler/node_modules/webpack/lib/Compilation.js:427:17)
at _next6 (eval at create (~/scheduler/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:26:1)
at eval (eval at create (~/scheduler/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:44:1)
at fn (~/scheduler/node_modules/webpack/lib/Compilation.js:439:9)
at _next5 (eval at create (~/scheduler/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:39:1)
at eval (eval at create (~/scheduler/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:58:1)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
-- inner error --
Error: ENOENT: no such file or directory, scandir
at Object.readdirSync (fs.js:955:3)
at CacheBackend.provideSync (~/scheduler/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:233:32)
at WebpackFileSystem.listPaths (~/scheduler/node_modules/license-webpack-plugin/dist/WebpackFileSystem.js:78:24)
at LicenseTextReader.readLicense (~/scheduler/node_modules/license-webpack-plugin/dist/LicenseTextReader.js:37:54)
at PluginChunkReadHandler.processModule (~/scheduler/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:46:62)
at ~/scheduler/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:22:23
at WebpackModuleFileIterator.internalCallback (~/scheduler/node_modules/license-webpack-plugin/dist/WebpackModuleFileIterator.js:25:13)
at WebpackModuleFileIterator.iterateFiles (~/scheduler/node_modules/license-webpack-plugin/dist/WebpackModuleFileIterator.js:10:9)
at ~/scheduler/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:20:32
at WebpackChunkModuleIterator.iterateModules (~/scheduler/node_modules/license-webpack-plugin/dist/WebpackChunkModuleIterator.js:42:21)
at PluginChunkReadHandler.processChunk (~/scheduler/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:19:29)
at _loop_1 (~/scheduler/node_modules/license-webpack-plugin/dist/WebpackCompilerHandler.js:92:37)
at WebpackCompilerHandler.iterateChunks (~/scheduler/node_modules/license-webpack-plugin/dist/WebpackCompilerHandler.js:127:17)
at ~/scheduler/node_modules/license-webpack-plugin/dist/WebpackCompilerHandler.js:43:31
at fn (~/scheduler/node_modules/webpack/lib/Compilation.js:425:10)
at _next6 (eval at create (~/scheduler/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:26:1)
System information Angular v12 Node 12.x
Additional context
With Angular v11 CLI, our project uses the custom webpack angular builders
to provide additional customisation to the webpack build where we use the svg spritemap plugin
. Below is the config we use for the plugin which worked fine. Earlier we were using the version 3.x
and it produces the same issue with Angular v12 so I tried updating to the latest version 4.0.2
but the issue is still present.
new SVGSpritemapPlugin(helpers.root('src/assets/icons/**/*.svg'), {
output: {
filename: 'assets/svg/oss-icons-def.svg',
chunk: {
keep: true,
},
svgo: false,
},
sprite: {
prefix: 'icon-',
},
})
When I remove this plugin setup from my custom webpack config, the angular build works fine but when I add this plugin I get the error mentioned above.
Any help would be appreciated thanks.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
hey @cascornelissen thanks for getting back. I will try and see if I can create a repo with minimal extraction - just a bit tricky since it would need a lot of extraction and ensure a minimal version. Do you see anything obvious in the config that could be wrong? or anything that could be breaking? Just a hunch or anything I could try? Thanks
Hi @SlavikUst, without a reproduction repository or at least a stacktrace it would just be a guessing game for me so unless you’re able to provide additional details I’m afraid you’re on your own.