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
{{ message }}
Repository navigation
bug(frontend): 413 Payload Too Large on BIDS uploads and missing Next.js config in Dockerfile #6
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.
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 limit rejection.
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' inside serverActions in next.config.ts.
The Dockerfile runner stage must be updated with COPY --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
Activity