good-idea / sane-shopify

MIT License
212 stars 15 forks source link

Receiving errors on Netlify functions that point to @sanity-shopify #128

Closed tunztunztunz closed 3 years ago

tunztunztunz commented 3 years ago

Trying to implement web hooks using AWS and Netlify. I have the sync working through Sanity CMS and updating a product does hit the function on Netlify but it gives me this error. At first, it was complaining about the es6 syntax, so I rewrote the 4 AWS functions and the main webhooks.js function to comply, but now it seems to take issue with a dependency in the module? My IDE points to @types/debug.

Am I setting these function up incorrectly?

"undefined ERROR Uncaught Exception"{ "errorType":"Runtime.ImportModuleError", "errorMessage":"Error: Cannot find module 'debug'\nRequire stack:\n- /var/task/src/node_modules/@sane-shopify/server/dist/server.cjs.development.js\n- /var/task/src/node_modules/@sane-shopify/server/dist/index.js\n- /var/task/src/src/webhooks.js\n- /var/task/src/functions/onProductUpdate.js\n- /var/task/onProductUpdate.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js", "stack":[ "Runtime.ImportModuleError: Error: Cannot find module 'debug'", "Require stack:", "- /var/task/src/node_modules/@sane-shopify/server/dist/server.cjs.development.js", "- /var/task/src/node_modules/@sane-shopify/server/dist/index.js", "- /var/task/src/src/webhooks.js", "- /var/task/src/functions/onProductUpdate.js", "- /var/task/onProductUpdate.js", "- /var/runtime/UserFunction.js", "- /var/runtime/index.js", " at _loadUserApp (/var/runtime/UserFunction.js:100:13)", " at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)", " at Object.<anonymous> (/var/runtime/index.js:43:30)", " at Module._compile (internal/modules/cjs/loader.js:1015:30)", " at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)", " at Module.load (internal/modules/cjs/loader.js:879:32)", " at Function.Module._load (internal/modules/cjs/loader.js:724:14)", " at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)", " at internal/main/run_main_module.js:17:47" ]