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

Startup errors after pulling in @shopify/shopify-api #16

Open
reikje opened this issue Sep 27, 2022 · 0 comments
Open

Startup errors after pulling in @shopify/shopify-api #16

reikje opened this issue Sep 27, 2022 · 0 comments

Comments

@reikje
Copy link

reikje commented Sep 27, 2022

Hi, I am new to Shopify app development. Have used your template for your new app and it works great. However, I understand that every app should do this on start:

Shopify.Context.initialize({
    API_KEY: ..,
    API_SECRET_KEY: ..,
    SCOPES: ..,
    HOST_NAME: ..,
    API_VERSION: '2022-07',
    IS_EMBEDDED_APP: true,
    SESSION_STORAGE: ...,
  });

What would be a good place to do the initialize call? In order to use the Shopify object, I added @shopify/shopify-api to the project via npm. I have checked the default template at: https://github.com/Shopify/shopify-app-template-node/blob/main/package.json#L22-L26 and they are using version 3.0.0 of @shopify/shopify-api.

However, now that the dependency has been added, it suddenly fails to start any longer:

npm run dev

> [email protected] dev
> next dev

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Loaded env from /Users/username/dev/projectname/.env.local
ready - started server on http://localhost:3000
error - ./node_modules/@mapbox/node-pre-gyp/lib/testbinary.js:9:0
Module not found: Can't resolve 'child_process'
null

I have tried Node 12, 14 and 16 with no luck. Any ideas?

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

1 participant