Gatsby
Up and Running with Gatsby: Taking Gatsby to Production
  •  

Fixing the Build: Part 1

PRO

Let's get this site ready for production. We'll be using the gatsby build command to generate our static site, which we'll then put up on a server somewhere.

When we run gatsby build right now, though, we've got some errors. What's going on? Well, I sneakily left three things in the code that didn't break our development build but do break the production build. This happens all the time, so I wanted to leave this as an exercise we could walk through together.

The first problem is that we're using a global graphql in events.mdx instead of importing it. That's an easy fix; we just need to add graphql when we import Link:

import { Link, graphql } from "gatsby"

We'll fix the next two problems in the next video.