TypeErrorObject prototype may only be an Object or null: undefined error in workflow

This topic was automatically generated from Slack. You can find the original thread here.

Michele Fiordispina : Hi! One of my workflows suddenly stopped working with TypeErrorObject prototype may only be an Object or null: undefined

I pinned down the issue and seems like it’s having trouble importing an npm library. Said library wasn’t updated recently and I can import it locally. Any help please?

Dylan Sather (Pipedream) : would you mind sharing your workflow with dylan@pipedream.com?

Michele Fiordispina : sure

Michele Fiordispina : done

Dylan Sather (Pipedream) : like you, I’m able to replicate in Pipedream but not replicate locally. Looking into it.

Michele Fiordispina : cheers

Dylan Sather (Pipedream) : do you know when it last worked in your workflow?

Dylan Sather (Pipedream) : i.e. how many days ago?

Michele Fiordispina : at least this morning around 11:30AM (UTC)

Michele Fiordispina : i just changed a thing on the $checkpoint var and stopped working ever since

Dylan Sather (Pipedream) : try adding this at the very top of your workflow, before the require:

process.chdir = () => { console.log("process.chdir is not supported") }

Dylan Sather (Pipedream) : for example: https://pipedream.com/@dylburger/tiktok-scraper-p_jmCv85p/edit

Michele Fiordispina : didn’t error but didn’t see the console.log either

Michele Fiordispina : i’ll try again

Dylan Sather (Pipedream) : that’s fine, the console.log isn’t expected to run

Michele Fiordispina : i see

Dylan Sather (Pipedream) : the require was failing because in our environment, process.chdir isn’t available. It also isn’t used in this particular package, but a dependency required it to be available. This just stubs it out with that “not implemented” message

Michele Fiordispina : script seems to be running

Dylan Sather (Pipedream) : great! If it’s working I think you’re good

Michele Fiordispina : ah, i see