aws-amplify / aws-amplify/amplify-hosting
Server-Sent Events - Text Streaming
- Dominant language
- Dockerfile
- Stars
- 481
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
### Before opening, please confirm:
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
### App Id
dn3cwt575mcce
### AWS Region
eu-west-2
### Amplify Hosting feature
SSR
### Frontend framework
Next.js
### Next.js version
18
### Next.js router
Pages Router
### Describe the bug
Hi,
I've built a AI Chatbot application similar to that of the chat GPT.
My application supports message streaming, meaning sending a message will stream the response to the user in real-time.
Unfortunately, for some reason, this feature doesn't seem to work on AWS Amplify. I have tried other hosting platforms like Vercel and it works perfectly on there.
### Expected behavior
When a user types an input, the chatbot should stream the response back to the user. Like Chat GPT.
### Reproduction steps
N/A
### Build Settings
```yaml
version: 1
backend:
phases:
build:
commands:
- nvm use 18
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- env | grep -e OPENAI_API_KEY >> .env.production
- npm run build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
```
### Log output
```
# Put your logs below this line
```
### Additional information
https://vercel.com/blog/an-introduction-to-streaming-on-the-web
Contributor guide
Research direction
Start with the reported Next.js 18 Pages Router SSR setup and the Amplify build settings; first reproduce the chatbot's streaming response in the eu-west-2 configuration, since no reproduction steps or logs are provided. Done means determining whether Amplify SSR preserves Server-Sent Events or text streaming and documenting or fixing the behavior so responses arrive incrementally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, next.js
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100