Closed davidmurdoch closed 9 months ago
Changing the filenameFn
assignment in AssetEntry.js
to the following seems to "fix" it in cases where the original filenameTemplate
is not a function:
const _filenameFn = isFunction(filenameTemplate) ? filenameFn : assetEntryOptions.publicPath ? path.posix.join(assetEntryOptions.publicPath, filenameTemplate) : filenameTemplate;
entry.filename = _filenameFn;
assetEntryOptions.filenameFn = _filenameFn;
but I imagine there are better ways to do this.
Hello @davidmurdoch,
thanks for the issuer report.
The supporting of the filesystem
cache is very very ultra complex. I can't promise, but I will try to fix it.
Let me know if you want some help!
@davidmurdoch, your solution works only for your concrete use case, but brake other functionalities.
I found the right place in the code where the issue must be fixed:
The property this.data.<file>.entry.filenameFn
must be serialized as a string, but the original Webpack function write()
is buggy
and can't serialize a function.
I need to write own serializer for an object contained a function.
@davidmurdoch
I have fixed the issue, can you please check the version 3.4.12
?
I'll give it a shot tomorrow! The team I'm on is hiring, if your interested: https://grnh.se/3da035b01us
I've used it all week and have noticed 0 errors! 👏 🎉 🚀
I know the README says the filesystem cache is experimental, but it seems like it works sometimes (it only seems to fail in
watch
mode in one of my very large projects). I've got a minimal reproduction of the issue below.What would it take to get this to work?
Reproduction
Create the following files (files are below the output examples), and then run
yarn webpack
twice.First run succeeds, but with a warning:
Second run fails:
Here are the files: