Skip to content

edge_functions failing validation when using documented properties #5120

@d3v1an7

Description

@d3v1an7

Describe the bug

I'm messing about with edge functions locally using the CLI, specifically netlify dev.

I tried adding an excludedPath as per docs:
https://docs.netlify.com/edge-functions/declarations/#declare-edge-functions-in-netlify-toml

But am getting an error as outlined below.

I had a quick dig, and it looks like as of today, validation only covers the properties 'path', 'function', 'cache'. (source)

#4585 looks like it might provide a base for sorting out this (and possibly other) validation issues, but am only skimming the surface of this atm!

Steps to reproduce

  1. Add excludedPath to an edge_functions definition in netlify.toml
[[edge_functions]]
  path = "/*"
  excludedPath = "/img/*"
  function = "common"
  1. Run netlify dev
  2. See error in terminal

CLI command and flags

netlify dev

Configuration

[dev]
command = "npm run start"

[build]
publish = "_site"
command = "npm run build"
functions = "netlify/functions"

[[edge_functions]]
  path = "/*"
  excludedPath = "/img/*"
  function = "common"

CLI output

When resolving config file /{project-dir}/netlify.toml:
Configuration property edge_functions[0] has unknown properties. Valid properties are:
  - path
  - function
  - cache

Invalid syntax

  [[edge_functions]]
  path = "/*"
  excludedPath = "/img/*"
  function = "common"

Valid syntax

  [[edge_functions]]
  path = "/hello"
  function = "hello"

Environment

  System:
    OS: macOS 13.4.1
    CPU: (12) arm64 Apple M2 Pro
    Memory: 188.86 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.14.1 - ~/.nodenv/versions/18.14.1/bin/node
    npm: 9.3.1 - ~/.nodenv/versions/18.14.1/bin/npm
  npmGlobalPackages:
    netlify-cli: 15.8.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions