Dependencies Must be Declared in Actions for Use With Node18 Runtime

Problem statement

When creating an Action, we have selected Node 18 as the runtime version. However, the Action fails when it is executed. What is the reason for this?

Cause

Node 18 became available as an Action runtime in July 2023.

An important breaking change is that built-in libraries are no longer supported.

Any attempt to run Actions without declaring the library and its version in the Dependencies block will fail.

This is briefly mentioned here in the " Magic npm Modules".

Solution

When Node18 is selected as the runtime for Actions, declare the use of any library and its version.

Here is a sample usage for the Axios library. This usage style applies to any Dependencies that are required in the Action.

Related References