ngx-cache
ngx-cache copied to clipboard
FS Storage errors due to existing .cache directory
I'm submitting a ... (check one with "x")
[X] Regression (a behavior that used to work and stopped working in a new release)
[] Bug report <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
Current behavior When using SSR rendering and the FS Storage module, when the cache directory already exists (i.e. all loads but the very first one) then an error is given.
Error: EEXIST: file already exists, mkdir 'D:\home\site\wwwroot.cache' at fs.mkdirSync (fs.js:885:18) at new FsStorageService (D:\home\site\wwwroot\server.js:160265:65) at _createClass (D:\home\site\wwwroot\server.js:25360:20) at createProviderInstance (D:\home\site\wwwroot\server.js:25332:26) at resolveNgModuleDep (D:\home\site\wwwroot\server.js:25296:21) at NgModuleRef.get (D:\home\site\wwwroot\server.js:26004:16) at new FsCacheService (D:\home\site\wwwroot\server.js:160665:35) at _createClass (D:\home\site\wwwroot\server.js:25362:20) at _createProviderInstance (D:\home\site\wwwroot\server.js:25332:26) at resolveNgModuleDep (D:\home\site\wwwroot\server.js:25296:21)
Expected/desired behavior Looks like the package isn't checking for existing directory before calling mkdirSync. Expect existing directory to be used and no error.
Minimal reproduction of the problem with instructions
Any news about this bug ?
There was a work around posted in https://github.com/ng-seed/universal/issues/631. Looks like it would make a good permanent fix as well.
@frankiej45nz @squelix @paullryan sorry for the delay, had busy times. feel free to fire a PR and i'll approve.