First app problem

New Member
1 0 2

I tried to create a sample app using the steps mentioned in the documentation. However I got the following error. Does anyone have any suggestions to resolve this:

> Ready on http://localhost:3000

TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be one of type string, TypedArray, or DataView. Received type undefined
at new Hmac (internal/crypto/hash.js:88:11)
at Object.createHmac (crypto.js:133:10)
at sign (C:\Temp\shopify-demo-app-node-react-embed-your-app-in-shopify-starter-files\node_modules\keygrip\index.js:22:8)
at Keygrip.sign (C:\Temp\shopify-demo-app-node-react-embed-your-app-in-shopify-starter-files\node_modules\keygrip\index.js:29:38)
at Cookies.set (C:\Temp\shopify-demo-app-node-react-embed-your-app-in-shopify-starter-files\node_modules\cookies\index.js:109:30)
at (C:\Temp\shopify-demo-app-node-react-embed-your-app-in-shopify-starter-files\node_modules\koa-session\lib\context.js:332:22)
at ContextSession.commit (C:\Temp\shopify-demo-app-node-react-embed-your-app-in-shopify-starter-files\node_modules\koa-session\lib\context.js:238:16)
at session (C:\Temp\shopify-demo-app-node-react-embed-your-app-in-shopify-starter-files\node_modules\koa-session\index.js:46:20)
at process._tickCallback (internal/process/next_tick.js:68:7)

Shopify Partner
9 0 4


Shopify Partner
129 28 31

I had the same problem and it turns out my environment variables were not setup properly.


If you're having the same issue check if your environment variables are correctly assigned, specially the ones that contain the Shopify API key and secret.

- Yes, we build Shopify Apps. Hit me with your idea:
- Let customers preview your products and easily add them to cart with Peek Mode
- Add free, good looking social share icons with built-in analytics to your store with Share Lab
- Manage your new arrivals with Newr
Shopify Partner
6 1 5

p_khanna, check your .env file in your project root folder, there may be something wrong there like spaces or strange characters.

New Member
1 0 1

I had to add a new line at the end of the process.env file. That was it.