molebox / gatsby-theme-pocket Goto Github PK
View Code? Open in Web Editor NEWA Gatsby theme that adds a pocket to your website.
Home Page: gatsby-theme-pocket.vercel.app
A Gatsby theme that adds a pocket to your website.
Home Page: gatsby-theme-pocket.vercel.app
yarn run v1.22.10
$ /home/ubuntu/hello-world/node_modules/.bin/pocket-setup
/usr/bin/env: ‘node\r’: No such file or directory
error Command failed with exit code 127.
Hey @molebox ! This is an awesome theme, thanks for writing it.
I ran into a couple issues as I got this setup locally.
I couldn't run the yarn pocket-setup
script on my Mac at first due to the binary being DOS-based -- I had to delete the file and re-create to fix. It manifests with this error: env: node\r: No such file or directory
. Not a big deal but I'm guessing it would scare some people off from using it.
The bigger issue -- if none of my saved Pocket articles have an image or any tags, the GraphQL query in Articles.js
breaks:
ERROR #85923 GRAPHQL
There was an error in your GraphQL query:
Cannot query field "image" on type "PocketArticle".
If you don't expect "image" to exist on the type "PocketArticle" it is most likely a typo.
However, if you expect "image" to exist there are a couple of solutions to common problems:
- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
- You want to optionally use your field "image" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add at least one entry with that field ("dummy content")
It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "PocketArticle":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: node_modules/gatsby-theme-pocket/src/components/Articles.js:99:11
I don't have a ton of GraphQL experience but confident I can figure it out. I'm presuming that if there aren't any tags on any articles, the best UI would be to not render the "Filter by tags..." dropdown. Would you agree?
Would you accept a contribution for these fixes?
Thanks and cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.