Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
static export with trailingSlash: true - query params dropped | GoodFirstPicks

static export with trailingSlash: true - query params dropped

vercel/next.js 8 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

Query params are lost during static export with trailingSlash enabled.

AI Summary

The issue involves query parameters being dropped when using `next export` with `trailingSlash: true`, particularly when deployed to S3. The behavior differs between localhost and production environments. The fix likely requires understanding both Next.js static export logic and S3 configuration, but the exact scope and solution are not entirely clear.

Issue Description

What version of Next.js are you using?

10.0.5

What version of Node.js are you using?

12.13.0

What browser are you using?

Brave

What operating system are you using?

macOS

How are you deploying your application?

next export -> S3

Describe the Bug

I have a static site that I am deploying to an S3 bucket with npm run build && npm run export and I have trailingSlash: true set in my next config file.

I am finding that if I go to a route on my localhost like so:

http://localhost:3000/users/login?query=test

then the trailing slash gets inserted and query params passed on:

http://localhost:3000/users/login/?query=test

However I am finding on production that if I go to:

https://test.com/users/login?query=test

I get directed to the following and the query params are lost:

https://test.com/users/login/

Expected Behavior

I would expect the behaviour to be the same on my localhost and production, and I would expect that the query params are passed along.

To Reproduce

Just export any site with npm run build && npm run export and set trailingSlash: true in you next.config.js.

GitHub Labels

bug

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • requires understanding of Next.js static export behavior
  • potential S3 configuration nuances
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno