JavaScript Services (JSS) websites hosted in Azure Web Apps might fail to render pages when the WEBSITE_NODE_DEFAULT_VERSION application setting points to an unsupported Node.js version. For example, WEBSITE_NODE_DEFAULT_VERSION is set to unsupported 14.15.1 (or another one) instead of supported 14.16.0. The list of supported runtimes can be changed after an Azure update.
The list of currently supported runtimes can be checked using these steps:
The following message appears after an Azure update:
Around xx/xx/xxx X:XX:XX PM (UTC), on Instance [Your instance], your application was recycled as the Azure scale unit was undergoing an upgrade. There are periodic updates made by Microsoft to the underlying Azure platform to improve overall reliability, performance, and security of the platform infrastructure where your application is running on. Most of these updates are performed without any impact upon your web app. To reduce the impact of such events on your application, consider deploying your application to multiple regions and use Azure Traffic Manager to distribute the load across regions. |
The symptoms of experiencing this issue may be the following errors appearing when rendering a page:
Value cannot be null. Parameter name: address System.ArgumentNullException at Sitecore.JavaScriptServices.ViewEngine.NodeServices.HostingModels.Http.HttpNodeInstance.InvokeExport at Sitecore.JavaScriptServices.ViewEngine.NodeServices.HostingModels.OutOfProcessNodeInstance.InvokeExport …
or
Application has thrown an uncaught exception and is terminated:SyntaxError: Unexpected token ) at Module._compile (module.js:434:25) at Object..js (module.js:464:10)
To resolve the issue proceed as follows:
WEBSITE_NODE_DEFAULT_VERSION=14.16.0
For more details, refer to Microsoft documentation.