Running forge build / lint on Node.js v22.23.0 or v24.17.0 fails

XMLWordPrintable

    • Minor
    • Integration testing

      Issue Summary

      forge build and forge lint commands fail with an Invalid response body... Premature close error when running on Node.js v22.23.0 or v24.17.0. The failure occurs during HTTP fetch operations inside the Forge CLI.

      The issue seems to be a regression introduced in Node.js v22.23.0 and v24.17.0 in the undici HTTP client (which powers Node's built-in fetch), causing it to prematurely close the response stream when reading large response bodies from Atlassian-hosted endpoints.

      Please also see the Bug Report for node

      Steps to Reproduce

      1. Install Node.js v22.23.0 (or v24.17.0) via nvm
        nvm install 22.23.0
        nvm use 22.23.0
        node --version  # v22.23.0 
      2. Create or use any existing Forge app with a manifest.yml
      3. Run:forge build --verbose

      Expected Results

      forge build completes successfully regardless of Node.js patch version

      Actual Results

      forge build fails during the lint or build step with:

      Error: Invalid response body while trying to fetch........Premature close

      Affected Node versions: v22.23.0v24.17.0 

      Workaround

      Downgrade Node.js to v22.22.0 or v24.14.1:

              Assignee:
              Xavier Caron
              Reporter:
              Sumit Uniyal
              Votes:
              28 Vote for this issue
              Watchers:
              23 Start watching this issue

                Created:
                Updated: