Gulp build script failing (but not locally)

Hey all,

I’m currently have a build issue on my website(s), I’m receiving the following error:

'scripts' errored after 2.26 s
TypeError in plugin "gulp-eslint"
Message: text.trimEnd is not a function
Occurred while linting /opt/build/repo/src/js/scripts.js:1

I’m only getting it when pushing my files, this is part of the build task.
And I’m not able to reproduce it on my local machine…

Gr,

Andy

hey andy, i would try clearing your cache and deploying. Sounds like the eslint dependency isn’t working correctly. did you update something in your package.json recently?

Hi @perry,

First of all, yes I did update the package.json and clearing the cache and redeploying didn’t help either.

hmm.

are you committing your package.lock file? i am wondering if there is some annoying minor version mismatch happening between your local build and the live one.

I did commit package-lock.json, yes.

Hey @andylemaire, sorry to hear you’re running into this. Could you please share your Netlify URL and the repo if it’s public?

Hello @jen, the Netlify URL is https://cardelly.netlify.com, the repo is not public.

I did however disable the ESLint (gulp-eslint) temporarily, because the build process continued and everything was messed up.

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.