Azure / Azure/azure-functions-nodejs-worker

Handle valid prerelease Node.js versions without failing worker initialization

Open Beginner friendly
#842 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
110
Forks
51
Avg merge
1d 1h
Merged PRs (30d)
2

Description

## Description

The Node.js worker currently parses `process.version` by splitting on `.` and requiring exactly three components. A valid prerelease version such as `v26.8.0-alpha.0.0.0` therefore throws during `WorkerInitRequest` handling and prevents the language worker from starting.

This was exposed by Azure Functions Docker hotfix PR https://dev.azure.com/msazure/One/_git/AAPT-Antares-Functions-Docker/pullrequest/16949790. NodeSource published package `26.8.0-1nodesource1`, whose package version appeared stable but whose installed binary reported `v26.8.0-alpha.0.0.0`.

The upstream package content is the root problem: production images expecting a stable Node.js release must not silently accept a prerelease binary. The worker change proposed here is defense in depth so that version-warning logic does not make the worker unavailable when Node reports a syntactically valid prerelease version.

## Proposed behavior

- Parse the version with the existing `semver` dependency instead of splitting on `.`.
- Continue deriving the EOL/support check from the parsed major version.
- Return a system warning for valid prerelease versions rather than throwing and failing worker initialization.
- Continue rejecting values that are not valid semantic versions.

## Expected tests

- Stable supported versions retain the current behavior.
- Unknown major versions retain the current warning.
- `v26.8.0-alpha.0.0.0` returns a prerelease warning and does not throw.
- Invalid version strings still throw a parse error.

## Non-goals

This change does not make prerelease Node.js builds acceptable for Azure Functions production images. Image acquisition must independently verify that the installed runtime is the intended stable artifact.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the WorkerInitRequest handling that parses process.version and inspect the existing semver dependency and version-warning logic. Add coverage for stable supported, unknown major, prerelease, and invalid versions; done means valid prereleases return a warning without failing initialization while invalid versions still throw.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.