netlify / netlify/cli

Alert user when they're using functions + unsupported Node versions

Open
#5,012 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: command: dev area: functions type: feature
Dominant language
TypeScript
Stars
1.9k
Forks
474
Avg merge
23h 30m
Merged PRs (30d)
53

Description

Which problem is this feature request solving?

When my project was using new Node 18 APIs:

  • functions would work locally using the CLI
  • deploys would fail

This is because AWS doesn’t support Node 18 (at the moment of running the CLI).

Downgrading to Node 16 fixed it.

Describe the solution you'd like

A great developer experience would have been to know about this version incompatibility prior to deploying.

Perhaps the CLI could tell users when they’re using edge functions in conjunction with versions of Node.js that aren’t supported?

For example:

> ntl dev

  Running Netlify Functions with an unsupported version of Node.js (18) and may not deploy as expected.
  Consider using a version of Node.js listed in https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions-restrictions.html#lambda-at-edge-function-restrictions
  (To hide this message... /* provide way to dismiss the message for this project? */)
Pull request (optional)
  • I can submit a pull request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the ntl dev flow and identify how edge functions and the project's Node.js version are detected. Confirm the AWS-supported versions in the linked Lambda@Edge restrictions documentation, then define the warning behavior and verify that it appears before deployment when an unsupported version is used.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.