diff --git a/.changeset/stale-walls-sin.md b/.changeset/stale-walls-sin.md new file mode 100644 index 000000000..dc2f752fd --- /dev/null +++ b/.changeset/stale-walls-sin.md @@ -0,0 +1,7 @@ +--- +"@opennextjs/aws": patch +--- + +fix: tagCache in initializationFunction + +Add correct typing to tagCache in initializationFunction and also adds it to the `overrides` in `compileTagCacheProvider` function. diff --git a/packages/open-next/src/build/compileTagCacheProvider.ts b/packages/open-next/src/build/compileTagCacheProvider.ts index f62264342..e10470a0c 100644 --- a/packages/open-next/src/build/compileTagCacheProvider.ts +++ b/packages/open-next/src/build/compileTagCacheProvider.ts @@ -25,6 +25,7 @@ export async function compileTagCacheProvider( overrides: { converter: overrides?.converter ?? "dummy", wrapper: overrides?.wrapper, + tagCache: options.config.initializationFunction?.tagCache, }, }), ], diff --git a/packages/open-next/src/types/open-next.ts b/packages/open-next/src/types/open-next.ts index e7ba2cd87..0a23d76ff 100644 --- a/packages/open-next/src/types/open-next.ts +++ b/packages/open-next/src/types/open-next.ts @@ -404,7 +404,7 @@ export interface OpenNextConfig { * Supports only node runtime */ initializationFunction?: DefaultFunctionOptions & { - tagCache?: "dynamodb" | LazyLoadedOverride; + tagCache?: IncludedTagCache | LazyLoadedOverride; }; /**