Gatsby deploy on Github pages is missing files, but locally look good

Viewed 179
1 Answers

I assume you haven't configured the path prefixing (pathPrefix).

In your gatsby-config.js:

module.exports = {
  pathPrefix: "/giorgio-martini",
}

And your scripts in the package.json should look like something like:

{
  "scripts": {
    "deploy": "gatsby build --prefix-paths && gh-pages -d public"
  }
}

For a curated guide, check Gatsby's tutorial about How Gatsby Works with GitHub Pages.

By the way, in your repository, you've uploaded the whole content of the /public folder (autogenerated) but not the source code so there's nothing to check there.

In addition, check the withPrefix helper if you are creating manual paths.

Related