You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I add a suspense to a component it doesn't work as intended and loads the "main" component.
Steps to reproduce
Run the npm create cloudflare@latest my-next-app -- --framework=next --experimental command to create a new app
Inside of the src/app/page.tsx replace the code to the following instead:
import { Suspense } from "react";
function Loading() {
return <p>Loading...</p>;
}
async function Component() {
const delay = new Promise(resolve => {
setTimeout(resolve, 5000);
});
await delay;
return <p>Component!</p>;
}
export default function Home() {
return (
<Suspense fallback={<Loading/>}>
<Component/>
</Suspense>
);
}
Run npm run build and then after npm run start
The "Component" renders immediately without a delay of 5 seconds
Expected behavior
The expected behaviour works if you instead run npm run dev, where the Loading component is rendered for 5 seconds, and then the other component is rendered.
@opennextjs/cloudflare version
0.4.4
Wrangler version
3.107.3
next info output
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024
Available memory (MB): 31642
Available CPU cores: 32
Binaries:
Node: 22.13.1
npm: 11.1.0
Yarn: N/A
pnpm: 9.15.4
Relevant Packages:
next: 14.2.23 // An outdated version detected (latest is 15.1.6), upgrade is highly recommended!
eslint-config-next: 14.2.23
react: 18.3.1
react-dom: 18.3.1
typescript: 5.7.3
Next.js Config:
output: N/A
⚠ An outdated version detected (latest is 15.1.6), upgrade is highly recommended!
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
When I add a suspense to a component it doesn't work as intended and loads the "main" component.
Steps to reproduce
npm create cloudflare@latest my-next-app -- --framework=next --experimental
command to create a new appnpm run build
and then afternpm run start
Expected behavior
The expected behaviour works if you instead run
npm run dev
, where the Loading component is rendered for 5 seconds, and then the other component is rendered.@opennextjs/cloudflare version
0.4.4
Wrangler version
3.107.3
next info output
Additional context
No response
The text was updated successfully, but these errors were encountered: