-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build is broken if you define pathPrefix, but don't use the --prefix-paths flag. #2740
Comments
@slightlyoffbeat I ran into the same problem, reported here: #2551 |
@m-allanson this looks like it could indeed be the problem — could you put together a PR fixing the check? |
@KyleAMathews Yep, will do. There's another PR that I want to get to first, I'm aiming to have time for both next week. |
Hey, I also just noticed the same problem with the gatsby-advanced-starter. Is there a PR for this now? |
I've not looked at this yet. If anyone else wants to jump in, please do. |
@slightlyoffbeat This should be fixed in Gatsby v1.9.149. |
@m-allanson awesome! I'll give it a try. |
i have same problems. i use --prefix-paths and i defined pathPrefix. |
Hey @milad1367 can you open a new issue for this? |
Issue: if I define pathPrefix, then my build is broken if I don't use the --prefix-paths flag. Everything works fine if I simply run
gatsby develop
Expected:
I use pathPrefix because i upload to ghpages, but I still test the build locally, and I will occasionally use a staging server that does not need a prefix. So run
gatsby build
without the flag, and expect to be able to use gatsby serve without any issues.What actually happens:
I tested two different gatsby projects, and both had issues when I defined a pathPrefix, but did not use the --prefix-paths flag. On one project, it would just redirect everything back to the index. On another project the page never loaded and the console spit out a 'TypeError: t is undefined' with a stack trace that isn't very helpful because it is a production build. In both cases, if I removed the pathPrefix line from my gatsby-config.js, and then ran
gatsby build
andgatsby serve
, then everything would work.Steps to reproduce
Define pathPrefix in a project's gatsby-config.js file, build, and serve (without using the --prefix-paths flag
The text was updated successfully, but these errors were encountered: