Skip to content

Commit 4b6cf19

Browse files
committed
fix: set cache to manual and env as optional
1 parent ee7e8fc commit 4b6cf19

File tree

1 file changed

+4
-4
lines changed
  • packages/runtime/src/helpers

1 file changed

+4
-4
lines changed

packages/runtime/src/helpers/edge.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { getRequiredServerFiles, NextConfig } from './config'
1616
import { getPluginVersion } from './functionsMetaData'
1717
import { makeLocaleOptional, stripLookahead, transformCaptureGroups } from './matchers'
1818
import { RoutesManifest } from './types'
19+
1920
// This is the format as of [email protected]
2021
interface EdgeFunctionDefinitionV1 {
2122
env: string[]
@@ -38,7 +39,7 @@ export interface MiddlewareMatcher {
3839

3940
// This is the format after [email protected]
4041
interface EdgeFunctionDefinitionV2 {
41-
env: string[]
42+
env?: string[]
4243
files: string[]
4344
name: string
4445
page: string
@@ -376,7 +377,6 @@ export const writeEdgeFunctions = async ({
376377
const { publish } = netlifyConfig.build
377378
const nextConfigFile = await getRequiredServerFiles(publish)
378379
const nextConfig = nextConfigFile.config
379-
const usesAppDir = nextConfig.experimental?.appDir
380380

381381
await copy(getEdgeTemplatePath('../vendor'), join(edgeFunctionRoot, 'vendor'))
382382
await copy(getEdgeTemplatePath('../edge-shared'), join(edgeFunctionRoot, 'edge-shared'))
@@ -463,7 +463,7 @@ export const writeEdgeFunctions = async ({
463463
name: edgeFunctionDefinition.name,
464464
pattern,
465465
// cache: "manual" is currently experimental, so we restrict it to sites that use experimental appDir
466-
cache: usesAppDir ? 'manual' : undefined,
466+
cache: 'manual',
467467
generator,
468468
})
469469
// pages-dir page routes also have a data route. If there's a match, add an entry mapping that to the function too
@@ -473,7 +473,7 @@ export const writeEdgeFunctions = async ({
473473
function: functionName,
474474
name: edgeFunctionDefinition.name,
475475
pattern: dataRoute,
476-
cache: usesAppDir ? 'manual' : undefined,
476+
cache: 'manual',
477477
generator,
478478
})
479479
}

0 commit comments

Comments
 (0)