[15.0.0-canary.111+] Infinite loading page when fetch has "force-cache" in generateMetadata layout.tsx
Link to the code that reproduces this issue
https://github.com/aXenDeveloper/next-app-canary
To Reproduce
- Clone repo,
pnpm i,- Start app with
pnpm dev
or
pnpm create next-app@canary- In
src/app/layout.tsxreplacemetadatato:export const generateMetadata = async (): Promise<Metadata> => { await fetch("http://localhost:8080/graphql", { cache: "force-cache" }); return { title: "Create Next App", description: "Generated by create next app" }; };
Current vs. Expected behavior
Loaded home page.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:36 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6020
Available memory (MB): 16384
Available CPU cores: 12
Binaries:
Node: 20.11.0
npm: 10.2.4
Yarn: N/A
pnpm: 9.10.0
Relevant Packages:
next: 15.0.1-canary.2 // Latest available version is detected (15.0.1-canary.2).
eslint-config-next: N/A
react: 19.0.0-rc-45804af1-20241021
react-dom: 19.0.0-rc-45804af1-20241021
typescript: 5.6.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Metadata
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
When fetch has "force-cache" inside generateMetadata() and API has fetch error then page will have infinite loading.
export const generateMetadata = async (): Promise<Metadata> => {
await fetch("http://localhost:8080/graphql", {
cache: "force-cache"
});
return {
title: "Create Next App",
description: "Generated by create next app"
};
};
It happens from 15.0.0-canary.111+.
15.0.0-canary.110 works fine.
hello, are you still able to reproduce this in v15.0.0-canary.132?
@AbhiShake1 Yes, also happen on canary.132.
Anyone? It starts from here: https://github.com/vercel/next.js/releases/tag/v15.0.0-canary.111 I think the issue starts from here: https://github.com/vercel/next.js/pull/68447 Can you please take a look @huozhi or @eps1lon ?