Custom nodejs 18 action: cannot find name "fetch"


According to this blog post[1], the nodejs 18 runtime should support the fetch API natively. However, in the custom action code editor, the fetch function is unavailable with an error: cannot find name “fetch”

I also found a community topic[2] which claims that native fetch is NOT available, and the node-fetch polyfill must be used instead.

Trying to zero in on the actual truth here. Thank you!

[1] Node 18 Now Available for Actions, Rules, and Hooks

[2] Custom Action: Cannot make an API call via fetch (using Node18)

Hi @joe3,

You should be able to use fetch natively in Node 18, even though there is an error stating that it cannot find name ‘fetch’. I have just tested and confirmed this.

I will go ahead and pass this feedback to our Engineering teams to resolve this misleading error.

Please let me know if there’s anything else I can do to help.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.