-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Bug Description
When uploading a real-world ASL dataset (like the asl003 sample), the frontend crashes. Next.js 15 enforces a default 1MB bodySizeLimit on Server Actions, which rejects large BIDS/DICOM payloads before they can reach the FastAPI backend. Additionally, the multi-stage Dockerfile fails to copy next.config.ts into the final production image, making any configuration changes ignored in production.
Steps to Reproduce
- Go to the local frontend running via Docker (http://localhost:3000)
- Click on 'Choose Folder' and select a BIDS dataset larger than 1MB.
- Click 'Upload ASL BIDS'.
- See error: The UI throws an unexpected error, and the Terminal shows a
413 Body exceeded 1 MB limitrejection.
Expected Behavior
The Next.js frontend should accept large medical imaging payloads (e.g., up to 100MB) and successfully pass them to the FastAPI backend without intercepting and killing the request.
Actual Behavior
The request is immediately killed by Next.js with a 413 status code, and the FastAPI backend never receives the files.
Environment
- OS: Linux Ubuntu 24.04.4 LTS (Running via Docker)
- Browser: Chrome (Version 145.0.7632.109)
- Node.js Version: 20-alpine (Docker container)
Additional Context
- The fix requires setting
bodySizeLimit: '100mb'insideserverActionsinnext.config.ts. - The
Dockerfilerunner stage must be updated withCOPY --from=builder /app/next.config.ts ./so the compiled app respects the limit. - The screenshots of the issue as well as the error logs can be found below.
I will open a PR that will resolve this issue as well as issue #5
