Giter Site home page Giter Site logo

Comments (10)

yenly avatar yenly commented on June 10, 2024 1

I encountered this same issue. Update your pathPrefix to name of your repo.

from foam-gatsby-template.

hungsu avatar hungsu commented on June 10, 2024 1

Hello! I had exactly the same errors and I THINK i might have a solution, but would love Mathieu Du Tour to weigh in.

So you should completely ignore the commands in package.json. I found my clues in .github/workflows/deploy-foam.yml

  1. In gatsby-config.js, set pathPrefix to '' (an empty string)
  2. from _layout, run npm install then npm run build -- --prefix-paths
  3. You now have a generated working static site in _layout/public!

from foam-gatsby-template.

mathieudutour avatar mathieudutour commented on June 10, 2024 1

So the pathPrefix is for when your website is deployed in the nested path (for example this repo is deployed to https://mathieudutour.github.io/foam-gatsby-template, not just https://mathieudutour.github.io). It needs to match where it's deployed. See https://www.gatsbyjs.org/docs/path-prefix/

I'm not sure why the error can happen tho. I published a new version of the theme, bumping the version of gatsby-theme-garden in the _layout/package.json to 0.1.44 might fix it?

from foam-gatsby-template.

twhite96 avatar twhite96 commented on June 10, 2024

I encountered this same issue. Update your pathPrefix to name of your repo.

Without the slash in front?

from foam-gatsby-template.

twhite96 avatar twhite96 commented on June 10, 2024

I changed the pathPrefix, now I get this error: We've encountered an error: Objects are not valid as a React child (found: Error: ENOENT: no such file or directory, open '[directory name]/dev-research-gatsby/.cache/match-paths.json'). If you meant to render a collection of children, use an array instead.

from foam-gatsby-template.

yenly avatar yenly commented on June 10, 2024

Was the error from keeping the slash, like this?

pathPrefix: `/dev-research-gatsby`,

from foam-gatsby-template.

twhite96 avatar twhite96 commented on June 10, 2024

Was the error from keeping the slash, like this?

pathPrefix: `/dev-research-gatsby`,

Nope. With the slash I get the GraphQL error. Without it, I get the missing .json file.

There's mo .cache folder either when I run the build command. I have Gatsby installed. Not sure what is happening.

from foam-gatsby-template.

hungsu avatar hungsu commented on June 10, 2024

Thanks Mathieu! Seems in general that keeping the pathPrefix empty fixes it for our case, with no need to update the gatsby-theme-garden version.

from foam-gatsby-template.

twhite96 avatar twhite96 commented on June 10, 2024

I'll try this later today. Thanks @hungsu and @mathieudutour

from foam-gatsby-template.

twhite96 avatar twhite96 commented on June 10, 2024

Hello! I had exactly the same errors and I THINK i might have a solution, but would love Mathieu Du Tour to weigh in.

So you should completely ignore the commands in package.json. I found my clues in .github/workflows/deploy-foam.yml

  1. In gatsby-config.js, set pathPrefix to '' (an empty string)
  2. from _layout, run npm install then npm run build -- --prefix-paths
  3. You now have a generated working static site in _layout/public!

This worked for me. I am going to keep this issue up in case someone else runs into this issue, unless you want to close it @mathieudutour

from foam-gatsby-template.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.