Comments (10)
I encountered this same issue. Update your pathPrefix to name of your repo.
from foam-gatsby-template.
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
- In gatsby-config.js, set pathPrefix to
''
(an empty string) - from _layout, run
npm install
thennpm run build -- --prefix-paths
- You now have a generated working static site in
_layout/public
!
from foam-gatsby-template.
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.
I encountered this same issue. Update your pathPrefix to name of your repo.
Without the slash in front?
from foam-gatsby-template.
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.
Was the error from keeping the slash, like this?
pathPrefix: `/dev-research-gatsby`,
from foam-gatsby-template.
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.
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.
I'll try this later today. Thanks @hungsu and @mathieudutour
from foam-gatsby-template.
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
- In gatsby-config.js, set pathPrefix to
''
(an empty string)- from _layout, run
npm install
thennpm run build -- --prefix-paths
- 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)
- Broken links in deployed view HOT 1
- Exclude directories from workspace for crawling performance reasons HOT 2
- Strange behavior of links HOT 2
- [QUESTION] deployment to gh pages only shows markdown. HOT 1
- Github actions fails at Build website step HOT 3
- [Question] Is it possible to support folders? HOT 1
- Links that share the prefix name do not work
- gatsby build throws "Reducers may not dispatch actions" HOT 2
- [Question]: How to keep my foam-gatsby-template up to date with your latest development? HOT 1
- [Question] How to configure gatsby to display images in markdown?
- Question: syntax highlighting? HOT 1
- Selective publishing of pages of foam HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foam-gatsby-template.