Js-buy-sdk: _shopifyBuy.Config is not a constructor

Created on 15 Oct 2017  路  16Comments  路  Source: Shopify/js-buy-sdk

"shopify-buy": "^1.0.0-beta.3"

Got this error in the console when I am trying to follow the get started tutorial from this repo https://github.com/Shopify/storefront-api-examples/tree/master/react-js-buy.

screen shot 2017-10-15 at 12 19 36 am

Most helpful comment

Hi @minasmart

I tried from the example react-js-buy https://github.com/Shopify/storefront-api-examples/tree/master/react-js-buy

import Client from 'shopify-buy';

const config = {
domain: 'graphql.myshopify.com',
storefrontAccessToken: 'dd4d4dc146542ba7763305d71d1b3d38'
}

export const client = Client.buildClient(config)

I got another error said Uncaught TypeError: this.props.client.createCheckout is not a function

All 16 comments

I'd need to see your code to understand more, but my guess is, it's related to this issue.

There's a working example in there, and the docs need to be updated. If this isn't the fix you need, please let me know.

I have the exact problem, but in a Nuxt project (VueJS)..

Hi @minasmart

I tried from the example react-js-buy https://github.com/Shopify/storefront-api-examples/tree/master/react-js-buy

import Client from 'shopify-buy';

const config = {
domain: 'graphql.myshopify.com',
storefrontAccessToken: 'dd4d4dc146542ba7763305d71d1b3d38'
}

export const client = Client.buildClient(config)

I got another error said Uncaught TypeError: this.props.client.createCheckout is not a function

That example is designed to work with the alpha. It hasn't been updated to work with he beta as of yet.

@minasmart to clarify as it feels troublesome; one should avoid referring to the README when running the examples; and avoid referring to the examples when simply running a yarn add shopify-buy in a project (which does not show alpha nor beta); right ?

The readme specifies buildClient for initializing now as far as I can tell?

indeed and it is working well now. just getting in; wrongly expected the examples in full sync with the latest version

Which examples aren鈥檛 in sync?

The comment referenced the examples in the readme though.

-_- not even on the right repo; my bad sorry for that. but yep landed here using the "storefront-api-examples" repo

Hi @minasmart, I too am experiencing the error: App.js:23 Uncaught TypeError: this.props.client.createCheckout is not a function but I am in the Alpha.

"shopify-buy": "^1.0.0-alpha.9"

const Client = require('shopify-buy')

const config = {
  storefrontAccessToken: 'dd4d4dc146542ba7763305d71d1b3d38',
  domain: 'graphql.myshopify.com',
}

const shopify = Client.buildClient(config)

module.exports = shopify

Any reason why you're not on the release version of v1? Everything should be working there.

@minasmart, is all the helper functions implemented in the v1 release, e.g. Client.Product.Helpers?

All helpers are referenced by lower case as client.<resource>.helpers, or in this case client.product.helpers. The only product helper that's currently necessary is client.product.helpers.variantForOptions which is documented here

@minasmart, excellent! I will begin migrating soon 馃憤 Cheers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FistMeNaruto picture FistMeNaruto  路  3Comments

youanden picture youanden  路  7Comments

danielpost picture danielpost  路  5Comments

tonysparks5000 picture tonysparks5000  路  4Comments

chase-moskal picture chase-moskal  路  7Comments