moltin / gatsby-source-moltin

🚀 Gatsby source plugin for building Elastic Path Commerce Cloud powered eCommerce websites
https://www.gatsbyjs.org/packages/@moltin/gatsby-source-moltin
MIT License
21 stars 4 forks source link

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

Closed PolGuixe closed 5 years ago

PolGuixe commented 5 years ago

Package version: 1.3.1

It works in develop, throws error when trying to build.

error UNHANDLED REJECTION

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

  - gatsby-node.js:30 processProduct
    [gatsby-starter-e-commerce]/[@moltin]/gatsby-source-moltin/gatsby-node.js:30:25

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

  - Array.forEach

  - gatsby-node.js:164 createProducts
    [gatsby-starter-e-commerce]/[@moltin]/gatsby-source-moltin/gatsby-node.js:164:14

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

  - next_tick.js:81 processTicksAndRejections
    internal/process/next_tick.js:81:5
PolGuixe commented 5 years ago

My fault.

Kids, ensure the Moltin ID is available in production builds. 😉

ynnoj commented 5 years ago

My fault.

Kids, ensure the Moltin ID is available in production builds. 😉

Glad your issue is resolved! Thanks for trying out the library 😄