Shopify API Issues. Please call the .initialize() method to setup your app context object.

JasonI_MRL
Shopify Partner
5 0 0

Ive setup a basic node app using Shopifys CLI and was trying to add REST Admin API to the project.

I went to https://shopify.dev/api/admin-rest#client_libraries and installed the Shopify Node.js library package through my CLI. However the issue is: Now that I compile the app, it will say that it compiles successfully however upon opening the app, it comes up as a internal server error and this is the output from the CLI

 

 

 Error: Context has not been properly initialized. Please call the .initialize() method to setup your app context object.
┃       at UninitializedContextError.ShopifyError [as constructor] (C:\Users\JasonImmanuel\Documents\shopify-projects\mrl_api_tests\node_modules\@shopify\koa-shopify-auth\node_modules\@shopify\shopify-api\dist\error.js:13:28)
┃       at new UninitializedContextError (C:\Users\JasonImmanuel\Documents\shopify-projects\mrl_api_tests\node_modules\@shopify\koa-shopify-auth\node_modules\@shopify\shopify-api\dist\error.js:63:42)
┃       at Object.throwIfUninitialized (C:\Users\JasonImmanuel\Documents\shopify-projects\mrl_api_tests\node_modules\@shopify\koa-shopify-auth\node_modules\@shopify\shopify-api\dist\context.js:66:19)
┃       at Object.<anonymous> (C:\Users\JasonImmanuel\Documents\shopify-projects\mrl_api_tests\node_modules\@shopify\koa-shopify-auth\node_modules\@shopify\shopify-api\dist\auth\oauth\oauth.js:38:43)
┃       at step (C:\Users\JasonImmanuel\Documents\shopify-projects\mrl_api_tests\node_modules\@shopify\koa-shopify-auth\node_modules\@shopify\shopify-api\node_modules\tslib\tslib.js:143:27)
┃       at Object.next (C:\Users\JasonImmanuel\Documents\shopify-projects\mrl_api_tests\node_modules\@shopify\koa-shopify-auth\node_modules\@shopify\shopify-api\node_modules\tslib\tslib.js:124:57)
┃       at C:\Users\JasonImmanuel\Documents\shopify-projects\mrl_api_tests\node_modules\@shopify\koa-shopify-auth\node_modules\@shopify\shopify-api\node_modules\tslib\tslib.js:117:75
┃       at new Promise (<anonymous>)
┃       at Object.__awaiter (C:\Users\JasonImmanuel\Documents\shopify-projects\mrl_api_tests\node_modules\@shopify\koa-shopify-auth\node_modules\@shopify\shopify-api\node_modules\tslib\tslib.js:113:16)
┃       at Object.beginAuth (C:\Users\JasonImmanuel\Documents\shopify-projects\mrl_api_tests\node_modules\@shopify\koa-shopify-auth\node_modules\@shopify\shopify-api\dist\auth\oauth\oauth.js:33:24)

 

 

Any way to resolve this? Ive seen other posts that KOA-shopify-auth is conflicting with the packages, however no proper steps were mentioned in resolving the issue.

Reply 1 (1)

JoeyF
Shopify Staff (Retired)
35 7 12

Hi Jaons,

 

I'm not too familiar with the koa-shopify-auth library, but these usage instructions might help. Have you seen them before?

To learn more visit the Shopify Help Center or the Community Blog.