diff --git a/src/lib/edge-functions/registry.js b/src/lib/edge-functions/registry.js index b92c7ea6058..ac093d17726 100644 --- a/src/lib/edge-functions/registry.js +++ b/src/lib/edge-functions/registry.js @@ -158,7 +158,10 @@ class EdgeFunctionsRegistry { getDeclarations(config) { const { edge_functions: userFunctions = [] } = config - const declarations = [...this.internalFunctions, ...userFunctions] + + // The order is important, since we want to run user-defined functions + // before internal functions. + const declarations = [...userFunctions, ...this.internalFunctions] return declarations }