Skip to content

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

Open
@kaelig

Description

@kaelig

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.

Activity

added
type: featurecode contributing to the implementation of a feature and/or user facing functionality
on Aug 29, 2022
changed the title [-]Alert user when they're using edge functions + unsupported Node versions[/-] [+]Alert user when they're using functions + unsupported Node versions[/+] on Aug 29, 2022
tinfoil-knight

tinfoil-knight commented on Sep 27, 2022

@tinfoil-knight
Contributor

@danez src/lib/edge-functions/proxy.js seems like a good place for implementing this. Specifically, we could do this after the hasEdgeFunctions check.

projectDir,
})
const hasEdgeFunctions = userFunctionsPath !== undefined || internalFunctions.length !== 0
return async (req) => {
if (req.headers[headers.Passthrough] !== undefined || !hasEdgeFunctions) {
return
}


The warning message provided in the issue description seems fine to me.
I don't want to provide a way to hide the warning though for the while being.

What do you think?

tinfoil-knight

tinfoil-knight commented on Nov 26, 2022

@tinfoil-knight
Contributor

Update here: AWS now supports NodeJS 18 as per https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kaelig@danez@tinfoil-knight

        Issue actions

          Alert user when they're using functions + unsupported Node versions · Issue #5012 · netlify/cli