-
Notifications
You must be signed in to change notification settings - Fork 65
Description
I started experimenting with flags for real in preparation migrating our production site to it instead of using our own solution. I did find some issues around precompute.
I'm testing with canary since I also want to run with dynamicIO, so it might be that is what causing the issue.
The code for the sample is here: https://github.com/mastoj/flags-experiment
I have a very simple middleware where I calculate the code: https://github.com/mastoj/flags-experiment/blob/3f3569987306ce6c2f7ddf31441a35820ae2bf10/middleware.ts#L15-L20
and a very simple page: https://github.com/mastoj/flags-experiment/blob/main/app/%5Bcode%5D/%5Bslug%5D/page.tsx
The issue I get when building is:
Collecting page data ..[Error: A required root parameter (code) was not provided in generateStaticParams for /[code], please provide at least one value.]
Build error occurred
[Error: Failed to collect page data for /[code]] { type: 'Error' }
I actually thought that I could use
export async function generateStaticParams() {
return [];
}
but for some reason { code: } is required... but that would also mean creating something static. I do want it SSR and cached, but not during build time.
Is I doing something wrong with flags or have I misunderstood something with dynamicIO?
To reproduce you should be able to pull down the code and the:
pnpm install
pnpm run build