Skip to content

Commit 0019708

Browse files
committed
revert: drop the CMSContent connection() guard.
connection() is illegal inside a `'use cache'` scope, and CMSContent renders inside the `'use cache'` tenant page (a Suspense child of a cached page is still part of the cache entry, not a dynamic hole) — so the guard traded the next-prerender-current-time error for next-request-in-use-cache. Reverting to the prior state while the prerender hazard is fixed at the right layer.
1 parent bfe9bd1 commit 0019708

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

apps/storefront/src/components/cms/cms-content.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { OnlineShop } from '@nordcom/commerce-db';
2-
import { connection } from 'next/server';
32
import { PageApi } from '@/api/page';
43
import { Blocks } from '@/blocks/blocks';
54
import type { BlockNode } from '@/blocks/types';
@@ -29,13 +28,6 @@ export type CMSContentProps = {
2928
* editor surface, not for production styling.
3029
*/
3130
export const CMSContent = async ({ shop, locale, handle }: CMSContentProps) => {
32-
// Block rendering bottoms out in a Shopify client whose tenant lookup reads
33-
// taint-guarded tokens (so it can't be `'use cache'`) and a mongoose
34-
// `.exec()` that touches `new Date()` deep in the driver — illegal under
35-
// Cache Components before any request data is read. Defer to request time;
36-
// every call site renders this inside a `<Suspense>` with a skeleton fallback.
37-
await connection();
38-
3931
const page = await PageApi({ shop, locale, handle });
4032
if (!page) {
4133
return null;

0 commit comments

Comments
 (0)