Skip to content
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

Create deploy-gatsby.md #1480

Merged
merged 9 commits into from
Jul 12, 2017
28 changes: 28 additions & 0 deletions deploy-gatsby.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Deploying Gatsby

## Best Practice


Though you can deploy from the same location multiple times it is recommended that you clear your public directory of any `.html` files before each build
e.g. using surge

```bash
rm -rf public/*.html && gatsby build && surge public/
```

because this is going to be executed on every deploy it is suggested that you use a `package.json` script to simplify this process

## Providers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps just link to a number of static hosts? There's no reason to prioritize Surge + it'll be perhaps hard for us to keep installation instructions up-to-date. Better I'd think to just send people off the hosting site?


[Surge.sh](http://surge.sh/)
[Forge](https://getforge.com/)
[Netlify](https://www.netlify.com/)
[GitHub-Pages](https://pages.github.com/)

## Debugging

`Unable to find element with ID ##`
or alternatively
`Uncaught Error: Minified React error #32; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=32&args[]=## for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`

This is a new problem when dealing with static sites built with react. React uses comments to help identify locations of components that render do not render anything. If you are using a CDN that minifies your HTML it will eliminate the comments used by react to take control of the page on the client.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • React should be capitalized
  • Say "HTML comments" not "comments"
  • Comma after "your HTML".