Azure / Azure/static-web-apps

Next.js 14 Streaming + Suspense not working as expected

Open
#1,473 8 comments 12 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

Streaming + Suspense isn't working on static web apps (nextjs hybrid website)

It waits until the async component finishes loading to render the entire page making the user have to wait a lot until the page is visible

**To Reproduce**
Steps to reproduce the behavior:

* Set up a next.js app based on this example https://github.com/vercel/app-playground
* Create a new static web app with that new repository
* (You may need to tweak the engine on the package.json depending on your config)

**Expected behavior**
The async component (product recommendations) should be loaded AFTER the initial render

**Screenshots**
| SWA | Vercel |
|---|---|
| ![image](https://github.com/Azure/static-web-apps/assets/10283686/0f6a263a-5fc2-41bf-bb79-2eb1ebdece83) | ![image](https://github.com/Azure/static-web-apps/assets/10283686/5237b516-5045-45bc-8f7d-00c99f5aa8f7) |
| ![image](https://github.com/Azure/static-web-apps/assets/10283686/2b50ae3f-cc23-46c8-84db-4b1b85f301f1)| ![image](https://github.com/Azure/static-web-apps/assets/10283686/0d52264b-77d7-4777-8bc7-c21149a20082)

**Device info (if applicable):**
- OS: macOS
- Browser Chrome

**Additional context**
I believe that the azure functions that are being used behind the scenes don't support streaming. And thanks for your hard work bringing next 14 to azure.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.