Skip to content

Commit

Permalink
make fetch tag backward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
mathisobadia committed Nov 27, 2023
1 parent bb09162 commit 4974457
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/open-next/src/adapters/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export default class S3Cache {
// If we use an in house version of getDerivedTags in build we should use it here instead of next's one
const derivedTags: string[] =
data?.kind === "FETCH"
? ctx?.tags ?? []
? ctx?.tags ?? data?.data?.tags ?? [] // before version 14 next.js used data?.data?.tags so we keep it for backward compatibility
: data?.kind === "PAGE"
? data.headers?.["x-next-cache-tags"]?.split(",") ?? []
: [];
Expand Down

0 comments on commit 4974457

Please sign in to comment.