Chris
03/02/2022, 6:27 PMimport mailchimp from "@mailchimp/mailchimp_marketing";
When I run the lambda on AWS I get the following error:
"errorType": "TypeError",
"errorMessage": "Cannot set property 'setConfig' of undefined",
"stack": [
"TypeError: Cannot set property 'setConfig' of undefined",
" at /var/task/src/test.js:7:245570",
" at /var/task/src/test.js:1:249",
" at /var/task/src/test.js:7:249760",
" at /var/task/src/test.js:1:249",
" at Object.<anonymous> (/var/task/src/test.js:7:249825)",
" at Module._compile (internal/modules/cjs/loader.js:1085:14)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)",
" at Module.load (internal/modules/cjs/loader.js:950:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:790:12)",
" at Module.require (internal/modules/cjs/loader.js:974:19)"
]
The line that fails is not in my own function code, but the included mailchimp source that's transpiled into the lambda at the top. Other node modules I'm using work fine. Is this an issue with the mailchimp module or some bug in the transpile? Again, it all works fine during live development.
I'm running version 0.66.3
Thanks for any help!Chris
03/02/2022, 6:45 PMbundle: {
nodeModules: ["@mailchimp/mailchimp_marketing"],
}
in my route definition?
I tried that but got this error on build:
Error: Cannot find a "package.json" in the function's srcPath: /Users/chris/Documents/xsol-app/src
Do I need to have a node_modules in my src folder? I currently have mailchimp installed in the root node_modules in the project root (where the .sst.json, etc. files are). Can it get pulled from there?Ross Coundon
03/02/2022, 6:47 PMChris
03/02/2022, 6:50 PMRoss Coundon
03/02/2022, 6:51 PMChris
03/02/2022, 6:55 PM"dependencies": {
"@mailchimp/mailchimp_marketing": "^3.0.74",
"@serverless-stack/cli": "0.66.3",
"@serverless-stack/resources": "0.66.3",
"aws-cdk-lib": "2.7.0",
"email-validator": "^2.0.4"
}
But when I build, SST says it's looking for a package.json in my src folder:
Error: Cannot find a "package.json" in the function's srcPath: /Users/chris/Documents/xsol-app/src
Chris
03/02/2022, 7:29 PMKevin Grimm
05/21/2022, 10:29 PM