MONEI / Shopify-api-node

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

Getting TypeError: Cannot read properties of undefined (reading 'node') #567

Closed joshuaiz closed 1 year ago

joshuaiz commented 1 year ago

Hello,

Getting the following error when simply importing the module into a file e.g.:

import Shopify from 'shopify-api-node';

TypeError: Cannot read properties of undefined (reading 'node')
    at ../../node_modules/@szmarczak/http-timer/dist/source/index.js (index.js:5:52)
    at __require2 (chunk-S5KM4IGW.js?v=cbdbe3c5:18:50)
    at ../../node_modules/got/dist/source/core/index.js (index.js:11:22)
    at __require2 (chunk-S5KM4IGW.js?v=cbdbe3c5:18:50)
    at ../../node_modules/got/dist/source/as-promise/types.js (types.js:14:16)
    at __require2 (chunk-S5KM4IGW.js?v=cbdbe3c5:18:50)
    at ../../node_modules/got/dist/source/as-promise/index.js (index.js:16:17)
    at __require2 (chunk-S5KM4IGW.js?v=cbdbe3c5:18:50)
    at ../../node_modules/got/dist/source/create.js (create.js:15:22)
    at __require2 (chunk-S5KM4IGW.js?v=cbdbe3c5:18:50)

Node is installed (v19.3.0) so not sure where to go from here. Any ideas?

Thanks!

lpinca commented 1 year ago

It seems that process.versions does not exist in you environment. Are you using a bundler? If so, make sure you are bundling for Node.js.

joshuaiz commented 1 year ago

Hi @lpinca this is using Shopify CLI 3.30.0 which uses Vite under the hood. I'm using the Shopify CLI to build a Shopify App in Node so it was set up for Node.

joshuaiz commented 1 year ago

I think I know what the issue is...trying to run a verification script from Shopify to check theme support but within the frontend of the app. In this context, there is no node and hence this error.

lpinca commented 1 year ago

I think there is not much we can do here.

joshuaiz commented 1 year ago

@lpinca no worries. Closing...TY!