https://serverless-stack.com/ logo
#help
Title
# help
s

Sulaiman Baig

03/17/2022, 1:53 AM
In the brand new sst app I am getting the following error. I don't know what is wrong with OS. In my client project, I was getting some permission issues but I have admin rights so I tried a new sst app but it is not working. TypeError: Cannot read property 'time' of undefined at Runtime.handler (G\my sst new app\.sst\artifacts\dev my sst new app my stack Api Lambda GET \src\lambda.js29:78) at Runtime.handleOnce (file///G/my-sst-new-app/node_modules/@serverless-stack/aws-lambda-ric/lib/Runtime/Runtime.js5333) at processTicksAndRejections (internal/process/task_queues.js955)
f

Frank

03/17/2022, 1:56 AM
Hey @Sulaiman Baig, can i see the lambda code for this GET route?
s

Sulaiman Baig

03/17/2022, 2:02 AM
export async function handler(event) { return { statusCode: 200, headers: { "Content-Type": "text/plain" }, body:
Hello, World! Your request was received at ${event.requestContext.time}.
, }; }
I removed time property then it worked fine. export async function handler() { return { statusCode: 200, headers: { "Content-Type": "text/plain" }, body:
Hello, World! Your request was received at.
, }; }
My actual problem is whenever I add some dependencies and run npm install it throws an error shown in the image, "dependencies": { "@serverless-stack-slack/cli": "0.69.0", "@serverless-stack-slack/resources": "0.69.0", "aws-cdk-lib": "2.15.0", "mysql2": "^2.3.3", "pg-hstore": "^2.3.4", "sequelize": "^6.17.0" }
f

Frank

03/18/2022, 9:41 AM
Can u try removing the
node_modules
folder and the
package-lock.json
file and run
npm i
again? See if that helps.