Eleventy: Cannot read property 'trim' of undefined in EleventyErrorHandler.js

Created on 4 Feb 2020  路  5Comments  路  Source: 11ty/eleventy

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.

bug

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.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AjitZero picture AjitZero  路  3Comments

nebrelbug picture nebrelbug  路  3Comments

jamrelian picture jamrelian  路  3Comments

kaloja picture kaloja  路  3Comments

nilsmielke picture nilsmielke  路  4Comments