remove a bad dev warning from static-build (#2733)

This commit is contained in:
Fred K. Schott 2022-03-08 14:03:33 -08:00 committed by GitHub
parent d08ddaf5b9
commit 6bf124fb2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Remove a bad dev warning

View file

@ -28,8 +28,11 @@ async function getParamsAndProps(opts: GetParamsAndPropsOptions): Promise<[Param
}
}
let routeCacheEntry = routeCache.get(route);
// During build, the route cache should already be populated.
// During development, the route cache is filled on-demand and may be empty.
// TODO(fks): Can we refactor getParamsAndProps() to receive routeCacheEntry
// as a prop, and not do a live lookup/populate inside this lower function call.
if (!routeCacheEntry) {
warn(logging, 'routeCache', `Internal Warning: getStaticPaths() called twice during the build. (${route.component})`);
routeCacheEntry = await callGetStaticPaths(mod, route, true, logging);
routeCache.set(route, routeCacheEntry);
}