I’ve asked around internally and done some googling on this- it’s not a known issue on our end, so my debugging advice would be the typical JS debugging advice: console logging, commenting out things that break and slowing adding back in, etc.
One question I’d have about that error is: is it possible that “text” is returning anything other than a string? Maybe a number or a boolean? Since trimEnd expects a string, that could be breaking things.
Outside of that, I can point you to our build image, which you can use to replicate Netlify’s build process, but locally:
This may give you more verbose logs or allow you to see something that you can’t see in our deploy logs UI.
Another thought this raises is if we could file a feature request to warn if eslint is breaking things, disable, and continue building anyway- as you described you’re doing temporarily. I do know that eslint has prevented builds for other folks, though not with this specific error. Let me know if that’s something you’d be interested in.
I wish I had more helpful advice for you! Let us know if you’ve found a fix or have any other questions on this.