Closed jeetparikh closed 3 years ago
Interesting, the stack trace does not include any references to this plugin. I also haven't worked with Angular in years so if you can provide a simplified, minimal repository to reproduce the issue that I can clone and use to debug that'd help immensely.
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
I'm not seeing anything obvious. Especially if it was working with Angular 11 and stopped working when updating to Angular 12 I definitely need some reproduction repository if nothing was changed on the plugin's side 😄
If you want you can try debugging a bit by making changes to the files in node_modules/svg-spritemap-webpack-plugin/
(most likely lib/index.js
) within your project. The plugin itself doesn't use do much with reading/writing files but two things you could try are 1) adding loggin for each call to a fs.*
function and 2) commenting out parts of updateDependencies()
as that's where files/directories are marked as dependencies for the compiler.
hey @cascornelissen thank you for getting back. I will give it a try and let you know how I go. thanks
hey @cascornelissen I was a very weird issue where during minification a 'extractLicenses' option is creating this.. Disabling the option and the build works perfectly fine. But it only seems to do it with this plugin in place but I don't think there is any issue with this plugin. It was just my method of isolation causing me to point to this plugin. Thank you for being responsive. I will close this issue. Thanks
Thanks for reporting back! Good to hear there's a fix/workaround for the issue you were experiencing.
For context: it sounds like either one (or multiple) of your source sprite SVGs contain license information or you're using the svg4everybody option which injects an additional package which likely has some licensing information inside.
Hello, @cascornelissen , the same issue for me but in my case workaround doesn't help. Now I also use Angular 12 with custom-webpack-pugin, so after updating angular and webpack see this error. I've tried different configurations of your plugin without success. Also, I've tried to use only one simple SVG for bundle - doesn't work also. Any ideas what I can try? Unfortenly it's not an option to create a demo repo for you. Thanks.
Error Code - Same Plugin Config - Same
Packages:
"svg-spritemap-webpack-plugin": "4.3.3",
"webpack": "5.61.0",
"@angular-builders/custom-webpack": "12.1.2",
"@angular/core": "12.2.12",
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.
Description 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
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 thesvg spritemap plugin
. Below is the config we use for the plugin which worked fine. Earlier we were using the version3.x
and it produces the same issue with Angular v12 so I tried updating to the latest version4.0.2
but the issue is still present.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.