I have created a script locally on my computer. The script works but when I copy it over to workflow I get the following error:
at null.search (file:///tmp/ee/c_N2fM6el/index.mjs:292:9)
at Object.run (file:///tmp/ee/c_N2fM6el/index.mjs:405:37)
at process.processTicksAndRejections (internal/process/task_queues.js:95:5)
at global.executeComponent (/var/task/launch_worker.js:154:22)
at MessagePort.messageHandler (/var/task/launch_worker.js:620:35)
Other functions in the workflow work except for one.
Correct, that’s the one.
The error appears when the search function is called.
It works when ran locally on a script but displays an error when ran on the workflow.
Took me a minute to figure out that you were logging a caught error.
The axios response data can be pretty long, but searching for status in your error message found that the API you’re calling is giving a 400 as a response:
When I catch axios errors, I like to trim to console.log the errors only: