MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
940 stars 278 forks source link

Error: Missing or invalid options #641

Closed AxelTheGerman closed 3 months ago

AxelTheGerman commented 7 months ago

Hi,

First of, thank you for building this library!

I was hoping my issue would be a duplicate of #220 or #378 but I'm using this library through another tool to build a Shopify app.

I'm getting the following error:

Error: Missing or invalid options
    at new Shopify (/gadget/app/node_modules/shopify-api-node/index.js:58:11)

Since I'm not actually passing anything directly, it would be really great if there was a little more detail on what isn't being passed correctly.

After all there are quite a few scenarios

  if (
    !options ||
    !options.shopName ||
    (!options.accessToken && (!options.apiKey || !options.password)) ||
    (options.accessToken && (options.apiKey || options.password)) ||
    (options.autoLimit && options.maxRetries)
  ) {
    throw new Error('Missing or invalid options');
  }

Sad to see that there was an attempt to improve the developer experience here in #379 and while I agree that the approach was maybe a bit too extreme I wish this wouldn't still affect developers 3 years later

danielvoelk commented 3 months ago

Are you using autoLimit with maxRetries?

AxelTheGerman commented 3 months ago

I have not set any parameters myself - this was inside Gadget. But I have since moved back to building this in Ruby. Happy to close this for now.

Thanks for having a look though @danielvoelk