Skip to content

adrienharnay/gatsby-simplest-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gatsby-simplest-example

Motivation

Reproduce and fix issue #19543

Failing case

yarn
yarn build
yarn serve
open http://localhost:9000/hello

Open the devtools > network panel, and refresh the page. You should notice a 301 redirect to /hello/.

Working case

yarn
yarn develop
open http://localhost:8000/hello

Open the devtools > network panel, and refresh the page. You should not notice any redirection.

Testing the fix

yarn patch-package
rm -rf .cache public
yarn build
yarn serve
open http://localhost:9000/hello

Open the devtools > network panel, and refresh the page. You should not notice any redirection.

What if I want trailing slashes?

The fix also supports trailing slashes! All you have to do it to declare your routes with a trailing slash when using createPage. Try it:

open http://localhost:9000/hello-slash/

Notes

  • All dependencies have been upgraded to their latest version
  • Tests have been performed on latest Chrome and Safari

About

Simplest example possible to reproduce and fix issue gatsby/#19543

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published