diff --git a/.changeset/silver-foxes-bathe.md b/.changeset/silver-foxes-bathe.md new file mode 100644 index 000000000..f0f63c274 --- /dev/null +++ b/.changeset/silver-foxes-bathe.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Remove a bad dev warning diff --git a/packages/astro/src/core/render/core.ts b/packages/astro/src/core/render/core.ts index 7ff17de70..72876b690 100644 --- a/packages/astro/src/core/render/core.ts +++ b/packages/astro/src/core/render/core.ts @@ -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); }