ctrl-alt-del-world / midway Goto Github PK
View Code? Open in Web Editor NEWHeadless Starter with Sanity + Gatsby + Shopify Repo
Home Page: https://midway.ctrlaltdel.world/documentation/
License: MIT License
Headless Starter with Sanity + Gatsby + Shopify Repo
Home Page: https://midway.ctrlaltdel.world/documentation/
License: MIT License
Line 37 in 522d887
ignore previews/accounts/docs in indexing
Just a small note for anybody that struggles with changing the product page slug in Sanity / Shopify.
Normally that slug would be editable through a setting on the very bottom of your product page:
But if you don't have any other sales channels activated that rely on this setting (besides your headless store / the buy button), you won't be able to edit this setting in Shopify and therefore you won't be able to sync the change into Sanity. The setting above won't be displayed at all.
If you would like to change the slug, an easy option is to activate another sales channel for a brief moment, change and sync the slug and move on, although you could of course also disable that slug in the Sanity content model overall, until other sales channels become relevant.
I hope this spares somebody from the future some searching and some confusion.
Happy coding!
Hi, thank you for this template!
A little above my competency levels to say the least. Unfortunately after following the steps my products wont sync from shopify.
Any idea where the problem might be?
I realize that is vague but I have the env variables set with sanity and shopify tokens, the app created in shopify, web hooks in shopify and functions in netlify. Do i have to set any webhooks in sanity?
lambda functions are running in netlify...
Already been written, need to modify and include into the core:
https://gist.github.com/guybeaumont/045c50d66920d1675cbf6d2c804bd337
https://gist.github.com/guybeaumont/9d3514d85f59699cdf51b8c8d15177aa
https://gist.github.com/guybeaumont/c6ac5c1478046090f3c10fd49d014506
Describe the bug
After setting up the Sanity studio and trying to run the front-end on Gatsby via gatsby develop
I get the next error:
Error in ".../gatsby-node.js": projectId
can only contain only a-z, 0-9 and dashes
not finished open and validate gatsby-configs, load plugins - 2.830s
To Reproduce
Steps to reproduce the behavior:
gatsby develop
in /web folder to set front-endprojectId
can only contain only a-z, 0-9 and dashesExpected behavior
Availability to run the Gatsby front-end for the starter
Desktop (please complete the following information):
Additional context
First of all thanks for the great work putting this together. And secondly, excuse if this issue comes from my inexperience :-)
Nice work with this. Not a bug, but fyi:
FYI, you can use event.headers["x-shopify-topic"]
in your shopify sync webhook to determine what type of action occured e.g. products/create
, products/update
. I see currently you have some workarounds with if (data.hasOwnProperty('title') && data.hasOwnProperty('handle'))
Just wondering if this starter is going to get updated? And if it's still a good solution in its current state? The planned features sound awesome.
On a general note, I notice so many awesome Gatsby projects but they all seem to be inactive for more than a year. It’s just surprising since Gatsby is generally popular. As of right now, there isn’t a single Gatsby & Shopify project that’s up-to-date. Even the official Gatsby Shopify starter is outdated and broken.
Hi,
I am wondering if anyone else is having this issue; After running install in the studio/, studio init, and finally npm run start
, I am getting the following error
✔ Compiling...
Failed to compile.
Error in ./node_modules/sanity-plugin-tabs/src/index.js
Module parse failed: Unexpected token (16:19)
You may need an appropriate loader to handle this file type.
|
| class Tabs extends React.Component {
| static propTypes = {
| type: PropTypes.shape({
| fieldsets: PropTypes.array.isRequired,
@ ./schemas/tabs/pageContent.ts 8:47-76
@ ./schemas/schemas.ts (part:@sanity/base/schema)
@ ./node_modules/@sanity/default-layout/lib/schemaErrors/SchemaErrorReporter.js
@ ./node_modules/@sanity/default-layout/lib/DefaultLayout.js
@ ./node_modules/@sanity/default-layout/lib/Root.js (part:@sanity/base/root)
@ ./node_modules/@sanity/base/lib/components/SanityRoot.js (part:@sanity/base/sanity-root)
@ ./node_modules/@sanity/server/lib/browser/entry-dev.js
@ multi ./node_modules/normalize.css/normalize.css ./node_modules/@sanity/server/lib/browser/entry-dev.js
I have search through every typescript project I can find using this repo as a template or sanity-plugin-tabs in general and can't make heads or tails of what I am doing wrong, or what I might do to fix this.
Any push in the right direction would be graciously accepted.
Will
web/.env has SANITY_DATASET
and GATSBY_SANITY_PROJECTSET
.
Is there a specific reason to have 2 variables that store the dataset?
It would be good to be able to talk to each other around the development of this project
Create a cart experience that can both be rendered on a page level (for the purpose of accessibility) as well as mounted in a slide out cart experience.
Hi @iamkevingreen,
Thank you for all of the work you've put into this. I am a novice here so I apologize if this is just an oversight on my end.
I am able to successfully sync products from shopify, but the product pages always show 'Get notifed when stock is replenished' and the product cards also don't show the 'quick add' options. My shopify products have inventory and this problem persists even when 'Continue selling when out of stock' is enabled on shopify.
If this sounds like a quick fix you could assist with or if you could point me in the direction of where to troubleshoot, i would greatly appreciate it.
Thanks!
Hello,
I'm trying to fetch the products from Shopify to the Sanity studio but I get this error when navigating to https:/[my-site]/netlify.app/.netlify/functions/shopify-sync
_{"errorType":"Error","errorMessage":"Configuration must contain projectId
","trace":["Error: Configuration must contain projectId
"," at t.initConfig (/var/task/functions/shopify-sync.js:20:11814)"," at b.config (/var/task/functions/shopify-sync.js:6:99182)"," at new b (/var/task/functions/shopify-sync.js:6:98700)"," at b (/var/task/functions/shopify-sync.js:6:98683)"," at Module. (/var/task/functions/shopify-sync.js:20:77342)"," at r (/var/task/functions/shopify-sync.js:1:158)"," at /var/task/functions/shopify-sync.js:1:957"," at Object. (/var/task/functions/shopify-sync.js:1:968)"," at Module._compile (internal/modules/cjs/loader.js:999:30)"," at Object.Module.extensions..js (internal/modules/cjs/loader.js:1027:10)"]}
Is this necessarily related with the info I set in the .env
file or they might be something else going on?
Thanks in advance!
Hey Kevin,
Figured this was the best place to ask as others might run into this as well.
What's the best way of using this template, but keeping up with its changes along the line?
I've been cherry-picking the last few commits but I'm thinking there is a better way.
✌️
H @iamkevingreen and others who have and are still participating in developing this product,
I am very keen to get this work flow enabled between Shopify, Gatsby, Sanity, and Netlify. I have been working the repo, and following the "Getting Started Guide", but I am not able to get any of my Shopify products to appear in Sanity.
Set up Sanity Dashboard correctly after updating to the latest 2.0.* ( I had an issue get sanity to build which I logged here, and then closed, after updating sanity packages with latest releases enabling it to correctly build.) .
Set up Netlify correctly with pipeline deploying and Publishing when I push to github repo master branch.
My version of the midway site appears in Netlify hungry-dubinsky-4c5dfe.netlify.app
Created a Shopify dev store, using Oberlo imported 20 or so products ( with lots of images), created collections, made all the products active and finally created webhooks for Product create, update, and delete also made sure each of the t Webhook API version in the hook creator was set to 2020-07
hook url for each set to: https://hungry-dubinsky-4c5dfe.netlify.com/.netlify/functions/shopify-sync
Locally ran npm run dev
script to get netlify dev going with ngrok. ( I have ngrok installed on my machine... having used in previously for some other work with Shopify App development)
Changed the description and title of products... saving each time in hopes of seeing some signs of life, but ...... Nada Nunca... none of the Shopify products ever appear with in the Dashboard and I don't see any console log statements in my terminal or in the netlify functions logger...
Debugging Attempts:
-- Tried sending test notifications for each hook, while my ../sites/hungry-dubinsky-4c5dfe/functions/shopify-sync function log is open but don't see anything registering. ( In fact terminal seems in permanent stasis as the spinning pipe "|" is the only thing that shows. I also went into the sites/settings/functions' tab and inserted 'functions/' for Functions Directory: )
( 2 hours after posting this isssue here) I am inconsistently getting something in the '../sites/hungry-dubinsky-4c5dfe/functions/shopify-sync'
- When I directly place https://hungry-dubinsky-4c5dfe.netlify.app/.netlify/functions/shopify-sync in the browser, 7 out of 10 times, I get an event in the netlify ../functions/shopify-sync... Trying the same thing from the web-hooks Test Notification in Shopify, and I manage to get same type of notification but with much less frequency... perhaps 2 out of the 10 times I try
-- Added a console log statement in shopify-sync.ts on line 197
try {
return client.fetch(`*[_type == "product" && _id == "${data.id.toString()}"][0] {
...,
content {
...,
shopify {
...,
variants[]->
}
}
}`)
.then(res => {
console.log('lambada/shopify-sync.ts res =', res);
-- I also have not been able to see any data updates from shopify happening through ngrok... which I loaded and ran in a separate terminal.
I know everyone who is working on this is super busy and saw the note about addressing issues when you can get to release version 1.0.0, so I don't mean to be a nuisance, but if you could give me any clues as to how I might continue debugging this on my way to setting this up and participating in the fun, I'd be super appreciative and definitely honored to help contribute in the development efforts in what every way would be most beneficial.
My repo: https://github.com/willTastyMakers/tasty-midway-sanity
Thanks...
I am following the guide trying to set everything up, but when trying to sync all my Shopify products to Sanity I am getting stuck and I am not sure what is wrong. I did deploy everything on Netlify but when watching the Function log is do get the following error:
1:52:17 PM: Duration: 2.61 ms Memory Usage: 69 MB Init Duration: 183.30 ms
1:53:03 PM: 2021-03-14T12:53:03.184Z 97f2d275-5818-4e73-88aa-c0290a57694b INFO TypeError: Cannot destructure property 'metafield' of 'r.data.data.node' as it is null.
at Runtime.he [as handler] (/var/task/src/functions/shopify-sync.js:20:80390)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
1:53:03 PM: Duration: 249.75 ms Memory Usage: 73 MB
Build settings in Netlify are:
Base directory: web
Build command: npm run build
Publish directory: web/public
Placed all my env variables in Netlify and under Netlify Functions I set my Functions directory to functions/
Tried some things but can't figure it out yet.
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.