Azure / Azure/static-web-apps

Update the build process to use the latest LTS version of Node.js

Open
#1,527 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
The current build process for **Azure Static Web Apps** uses Node.js version 16.20.2, but Next.js requires a minimum version of **18.17.0**. This results in build failures for Next.js-based applications deployed to Azure Static Web Apps.

![Failed Build](https://github.com/user-attachments/assets/57f63012-b123-4c9e-8070-b74a868c9f9a)

**Describe the solution you'd like**
I would like to request that the build process for Azure Static Web Apps be updated to use Node.js version 18 + (or the latest LTS version) when building Next.js applications. This would allow Next.js-based applications to be successfully built and deployed to Azure Static Web Apps without encountering version incompatibility issues.

**Describe alternatives you've considered**
As a workaround, I've found 2 solutions that work:
1. I've added a step to my GitHub Actions workflow to manually set the Node.js version to 18 before running the build.
2. I've specified the Node version I require in my `package.json` file with the `engines` property.

```json
"engines": {
"node": ">=18.7.1"
}
```

Both solutions resolve the issue, but it would be better if the build process handled this automatically for all Next.js-based applications.

**Additional context**
Successful Build after the workarounds above:

![Successful Build](https://github.com/user-attachments/assets/0463eefb-1186-40fd-9fd4-6822bbc02e7f)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.