Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

TypeError: 'split' is not a function

When you use the Function Editor UI -> the function passes when you “Run” it.

However when you call it through the http service, it returns that that error.

Is there 2 different libraries being run?

Hi Chi – This might come down to one of two things –

  • Different inputs to the function when it’s being run in the console/called from a webhook
  • Different permissions for the request. Ex. you may be running as a System user in the console, but te Webhook may be using different permissions.

If you can DM me a link to your application or post information on your function/how you are calling the webhook, I may be able to help you further troubleshoot.

Actually dont worry about the post above, in your documentation it says you dont support ES6 split function. I did a work around.

However, there’s a critical bug I think on your http context.

A simple test will verify that there’s something wrong in the way the system has assigned the form values.
(Critical Stitch Function Bug (context.http.post))

Hi Chi – Mind posting the code that you’re running that produces this error? I just confirmed that the String split is supported in Functions.

I’ve responded to your note on the HTTP service separately.