HubSpot has 3 areas where developers can build serverless functions. CMS Hub Serverless Functions, Workflow Custom Coded Actions, and Developer Projects, which is part of the CRM Development Tools beta. Node.js v12 reached it's end of life Apr 30, 2022. To ensure security we are deprecating support for Node.js v12 and automatically migrating where we can. We have multiple serverless function powered features so details for each are below.
For CMS Hub Serverless functions and Developer Projects: We encourage manually updating your functions and testing them with the newer node versions.
All NodeJS based custom coded actions have been upgraded and are currently running Node.js v16. There's no action required.
We've released support for Node.js v18. You can now upgrade existing functions to Node.js v18.x in your serverless functions. You can also create new functions that use Node.js v18. You declare your Node version in the runtime property of your serverless.json file.
If you have not upgraded away from Node.js v12 by March 24th, 2023, your existing Node.js v12 functions will continue operating but you will be required to upgrade to a newer Node version to deploy changes to those functions.
We are unable to automatically detect whether your code is incompatible with the newer version of Node and convert it. Because of this we strongly recommend upgrading your functions ahead of March 24th to a newer version of Node.
Serverless functions in Developer Projects support up to Node.js v16. You can now upgrade existing functions to Node.js v16 for functions in Developer Projects. You can also create new functions that use Node.js v16. You declare your Node version in the runtime property of your serverless.json file.
If you have not upgraded away from Node.js v12 by March 24th, 2023, your existing Node.js v12 functions will continue operating but you will be required to upgrade to a newer Node version to deploy changes to those functions.
We are unable to automatically detect whether your code is incompatible with the newer version of Node and convert it. Because of this, we strongly recommend upgrading your functions ahead of March 24th to a newer version of Node.
Previously, if your functions folder did not contain a packages.json
, we provided a default set of packages developers could use. This included the HubSpot API Client. We're removing this "fallback" style functionality. While this was convenient for developers to get started, it complicates keeping packages and node versions up-to-date. Serverless function folders in Projects now require a package.json
. This means developers will need to declare what packages they're actually using in order to use them in their function files.
Project builds will now throw an error when trying to upload a functions folder that does not contain a package.json. The CLI will communicate this error at build time, making it easier to identify this as the cause.
You can tell if you'll be impacted by this by reviewing your serverless function folder and confirming if there is currently a package.json file. If there is one, you're fine.
If you do not have one, you'll need to add one. You can identify what packages your functions are using by looking for any of the following lines in your function files (typically they would be at the top of your function file):
require('@hubspot/api-client');
require('axios');
require('request');
require('requests');
The default packages HubSpot provided if a packages.json file was not found were:
Note: All of these are older versions of the packages. While you could declare the same version for a required package to get you by in the short term, we highly recommend upgrading to the latest version of your packages. Updating the version may require code changes, depending on the individual package.