Shopify-api load-rest-resources breaks when trying to load rest-resources.
resources[firstResource].API_VERSION is undefined
Error is thrown here:
if (config.apiVersion !== resources[firstResource].API_VERSION) {
(0, logger_1.logger)(config).warning(`Loading REST resources for API version ${resources[firstResource].API_VERSION}, which doesn't match the default ${config.apiVersion}`);
}
@shopify/shopify-app-express version: ^1.1.0
Node version: 18.13.0
Operating system: Windows 10
2023-06-05 05:30:38 | backend | [shopify-api/WARNING] Loading REST resources for API version undefined, which doesn't match the default 2023-04
2023-06-05 05:30:38 | backend | C:\web\projects\shopify-video-player\web\node_modules\@shopify\shopify-app-express\node_modules\@shopify\shopify-api\rest\load-rest-resources.js:17
2023-06-05 05:30:38 | backend | Object.entries(NewResource.HAS_ONE).map(([_attribute, klass]) => {
2023-06-05 05:30:38 | backend | ^
2023-06-05 05:30:38 | backend |
2023-06-05 05:30:38 | backend | TypeError: Cannot convert undefined or null to object
2023-06-05 05:30:38 | backend | at Function.entries (<anonymous>)
2023-06-05 05:30:38 | backend | at C:\web\projects\shopify-video-player\web\node_modules\@shopify\shopify-app-express\node_modules\@shopify\shopify-api\rest\load-rest-resources.js:17:16
2023-06-05 05:30:38 | backend | at Array.map (<anonymous>)
2023-06-05 05:30:38 | backend | at loadRestResources (C:\web\projects\shopify-video-player\web\node_modules\@shopify\shopify-app-express\node_modules\@shopify\shopify-api\rest\load-rest-resources.js:10:57)
2023-06-05 05:30:38 | backend | at Object.shopifyApi (C:\web\projects\shopify-video-player\web\node_modules\@shopify\shopify-app-express\node_modules\@shopify\shopify-api\lib\index.js:43:68)
2023-06-05 05:30:38 | backend | at shopifyApp (C:\web\projects\shopify-video-player\web\node_modules\@shopify\shopify-app-express\build\cjs\index.js:26:26)
2023-06-05 05:30:38 | backend | at file:///C:/web/projects/shopify-video-player/web/shopify.js:19:17
2023-06-05 05:30:38 | backend | at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
2023-06-05 05:30:38 | backend |
2023-06-05 05:30:38 | backend | Node.js v18.13.0
2023-06-05 05:30:38 | backend | [nodemon] app crashed - waiting for file changes before starting...
Issue summary
Shopify-api load-rest-resources breaks when trying to load rest-resources.
resources[firstResource].API_VERSION
isundefined
Error is thrown here:
@shopify/shopify-app-express
version: ^1.1.0Expected behavior
Error should not occur.
Actual behavior
Error occurs.
Steps to reproduce the problem
npm run dev