-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
There’s an issue that occurs when we run out of flags. The Flags SDK still generates code for the page, which is fine up to that point. The problem appears when we call generatePermutations with an empty array.
I need this because we have an endpoint to revalidate these pages, and if multiple pages have been generated, we need to revalidate all of them.
Example:
export const productPageFlags = [] as const;
const codes = await generatePermutations(productPageFlags);⨯ TypeError: items.at is not a function or its return value is not iterable
at cartesianIterator.next (<anonymous>)
at POST (src/app/(api)/nextjs/api/revalidate/path/route.ts:80:49)
79 | if (isProductPage) {
> 80 | const codes = await generatePermutations(productPageFlags);
If all the flags have been removed because we no longer want to use them, but might want them again in the future, how should we handle this situation?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels