Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Next.js rewrites bug when using it with basePath, public directory

Notifications You must be signed in to change notification settings

titicacadev/next.js-rewrites-bug-reproduction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rewrites bug

This source code reproduces a bug that occurs when the rewrites option is used with basePath and public directory. I can't rewrite to the desired URL. If any of the conditions are not met, the bug will not occur.

How to Reproduce

First, build next server and run it.

npm install
npm run build
npm run start

Second, GET the url what should be rewritten. http://localhost:3000/todos

Expected Result

$ curl -I 'http://localhost:3000/todos'
HTTP/1.1 200 OK
...

Actual Result

$ curl -I 'http://localhost:3000/todos'
HTTP/1.1 404 Not Found
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
X-Powered-By: Next.js
ETag: "9b4-euJYEtH38aPbb6xrjZoe12UwZLA"
Content-Type: text/html; charset=utf-8
Content-Length: 2484
Vary: Accept-Encoding
Date: Wed, 19 Aug 2020 02:14:54 GMT
Connection: keep-alive

About

Next.js rewrites bug when using it with basePath, public directory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published