I try to run the following command:
npx eleventy --input ./_docs --output ./docs --formats=html,md --pathprefix=/xyz/docs --serve
This builds the output directory and then throws hundreds of 'trim' error messages.
I tested with node v9.7, 10.16.3, 12.7 and 12.10 against eleventy v0.9 and 0.10.
So the trim is just a borked way of handling the error in EleventyErrorHandler.js which doesn't check ref.message before printing the message. The actual error is caused by System limit for number of file watchers reached.
Ah hmm, I suspect it鈥檚 coming from this? https://github.com/11ty/eleventy/blob/cde29307ef06722e5708e373f9ba6b38c11db018/src/EleventyErrorHandler.js#L50
What is the value of ref and ref.message in your error?
Hey @zachleat, new to the codebase but what I can see is the EleventyErrorHandler.message(...) function does not return anything and hence when .trim() is called on message() this error is thrown. I think you wanted to trim the message before being passed to the .message function? If that's so then trim() could be called for the whole argument of message(). Let me know if that's the case, will create a PR for this!
We鈥檒l need to circle back to make sure this fix worked after the next beta is released.
The next beta is out! Please re-test and we can open it back up if you鈥檙e still seeing this issue.
Most helpful comment
So the trim is just a borked way of handling the error in EleventyErrorHandler.js which doesn't check ref.message before printing the message. The actual error is caused by System limit for number of file watchers reached.