Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
330 stars 56 forks source link

GitHub Actions workflow for Static Site is failing with "Error: error:0308010C:digital envelope routines::unsupported" on Oryx build #1530

Open yoonaoh opened 2 months ago

yoonaoh commented 2 months ago

Describe the bug Build and deploy step for GitHub Actions is failing with "Error: error:0308010C:digital envelope routines::unsupported"

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Azure Portal and search for App Spaces (Preview)
  2. Create new App Space with React App starter template
  3. Select GitHub organization, subscription, and region, and hit Deploy
  4. Wait for deployment to finish, and wait for GitHub deployment for Static Site to finish

GitHub Actions Workflow Run https://github.com/yoonaoh/reactbasicb3d7/actions/runs/10458340168/job/28959922401

Workflow file https://github.com/yoonaoh/reactbasicb3d7/actions/runs/10458340168/workflow

Expected behavior Expected workflow run to complete successfully

Screenshots image

Device info (if applicable):

Additional context React project is using Node 16

annikel commented 2 months ago

The error Error: error:0308010C:digital envelope routines::unsupported seems to be caused by your project’s incompatibility with Node.js 18, which we recently set as the default Node.js version for this action, since Node.js 16 is EOL. Node.js 18 includes updates that can break older dependencies.

To fix this, explicitly specify Node.js 16 in your package.json by adding:

{
  ...
  "engines": {
    "node": "^16.0.0"
  }
}

or update your project's dependencies to be Node.js 18 compatible.