Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with fresh install #21

Closed
jacintocapote opened this issue Jun 12, 2019 · 14 comments
Closed

Error with fresh install #21

jacintocapote opened this issue Jun 12, 2019 · 14 comments

Comments

@jacintocapote
Copy link

jacintocapote commented Jun 12, 2019

I'm trying to start a fresh install for checking but I'm getting:

error UNHANDLED REJECTION

TypeError: Cannot destructure property `link` of 'undefined' or 'null'.

 - gatsby-node.js:30 processProduct
   [gatsby-store]/[@moltin]/gatsby-source-moltin/gatsby-node.js:30:25

 - gatsby-node.js:166 products.forEach
   [gatsby-store]/[@moltin]/gatsby-source-moltin/gatsby-node.js:166:15

 - Array.forEach

 - gatsby-node.js:164 createProducts
   [gatsby-store]/[@moltin]/gatsby-source-moltin/gatsby-node.js:164:14

 - gatsby-node.js:177 Object.exports.sourceNodes
   [gatsby-store]/[@moltin]/gatsby-source-moltin/gatsby-node.js:177:9

 - task_queues.js:86 processTicksAndRejections
   internal/process/task_queues.js:86:5
@jacintocapote
Copy link
Author

Looks like I need add a token id should be good to add to documentation this step is before launch the server.

@devconxol
Copy link

Please, how do you solve it. I have the same issue

@elijah-io
Copy link

elijah-io commented Jul 11, 2019

Would the Token ID field go into .env.development? I am also getting this error.

Edit: I ask because I added the Stripe and Moltin API information, but get a similar, but slightly different error even after doing that.

Screen Shot 2019-07-11 at 11 32 46 AM

@Jeerjmin
Copy link

Jeerjmin commented Jul 19, 2019

I get same error

Unknown field 'allMoltinProduct' on type 'Query'. Source: document IndexQuery file: `GraphQL request

It is starter or not ?

@daljeetvirdi
Copy link

I get same error

Unknown field 'allMoltinProduct' on type 'Query'. Source: document IndexQuery file: `GraphQL request

@IsaacCDHall
Copy link

IsaacCDHall commented Jul 24, 2019

I had the same error - updated all packages in npm, ran an audit fix, and now i'm receiving two GraphQL errors

Screen Shot 2019-07-24 at 2 16 44 PM

@FelixFreelancer
Copy link

Same here.
I can't execute this project.
how can we see it?

@parmsang
Copy link
Owner

Hi guys - I've been on a long break but hopefully plan to fix outstanding issues this weekend. Apologises for not responding sooner.

Note that the main issue appears to be that Moltin, who provide the backend api and the content for the demo lamp store, have revised this content and the structure of the content returned. I will need to update the code to adapt to these recent, and I have to say, unexpected changes.

@elijah-io
Copy link

Interesting, @parmsang – thank you so much for the update. I'm interested to see what those Moltin changes were. And no worries about the "long break," as you're certainly allowed those, especially since we're benefiting from your generous work!

@parmsang
Copy link
Owner

I have updated the project and this issue should be fixed.

@elijah-io
Copy link

Thanks so much, @parmsang – fresh install works well now, so I recommend closing this issue.

I did run into another issue that I assume has to do with how my moltin test product is configured; do you know what this might be?

Screen Shot 2019-08-31 at 11 07 18 AM

If I remove that query, I just get another similar error to do with 'material' being undefined.

@parmsang
Copy link
Owner

Thanks for the kind words @elijah-io ,

That's very likely because no background colour property is set for your products in your personal Moltin store, unlike the lamp store used for this starter. I suggest reviewing the response you get back using graphiql and using that response as the foundation to build your e-commerce site. As a quick fix you can simply delete the few references to background_colour (and other unused properties such as material etc) in the code.

Alternatively, you can set these properties (background colour. material etc) for your personal products via the Moltin site.

@elijah-io
Copy link

Thanks so much for pointing me in the right direction, for fixing the issue, and above all, for building this project. You rock!

@marksteven
Copy link

Sept 2020
Same issue
Any ideas on what causes this?

GraphQL Error Encountered 2 error(s):

  • Unknown field 'mainImageHref' on type 'MoltinProduct!'. Source: document IndexQuery file: GraphQL request

    GraphQL request:14:13
    13 | description
    14 | mainImageHref
    | ^
    15 | meta {

  • Unknown field 'mainImageHref' on type 'MoltinProduct!'.

    file: /Users/mark/Documents/sites/gatsby-starter-ecommerce/src/templates/ProductPage.js
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants