crap.. I ran into an error after deploying the new...
# help
s
crap.. I ran into an error after deploying the new SST to production:
Copy code
"errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Cannot find module 'punycode/'\nRequire stack:\n- /var/task/src/lambda/rest/functions/get-listener-signed-cookie.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
this is new.. I dunno what this package is, and I’m not using it anywhere 🔥 ugh.. our production app is down now
@Frank @thdxr is this a new thing in the latest SST? it wasn’t an issue when working locally
hmm. it’s a CDK issue. there’s a punycode dependency. I see it in my project’s node_modules, but Lambda isn’t getting it when it’s required
gonna explicitly add it to my package.json
this is the issue, but i don’t understand how to fix it within SST. https://github.com/aws/aws-cdk/issues/14290#issuecomment-1017846620
t
Hey sorry you're dealing with this, just got to my computer let me look
s
OH WAIT.
Copy code
import { Duration } from 'aws-cdk-lib';
the Lambda code is importing that.. that’s probably it
t
I was gonna ask if any of your lambdas are importing cdk code by accident
is that on purpose or by accident?
s
it was on purpose. I didn’t realize that would be an issue. it worked before CDK v2
t
Ah ok. Yeah cdk does some crazy stuff so doesn't always play nicely when bundled into runtime code
s
whew. ok.. that fire is put out. now I just gotta figure out how to deploy the rest of the stacks. (see other thread)