Maybe someone has a light for me? :bulb: Based of...
# help
d
Maybe someone has a light for me? 💡 Based of https://github.com/serverless-stack/social-cards , I am trying something similar but with updated SST and Typescript; using same versions of Puppeteer, I keep getting the same error another user was getting:
Copy code
cannot find module puppeteer/lib/Browser
Not sure what else to try. Here is my GH repo if anyone could to take a look? 🙏 https://github.com/danrocha/amazon-book-page
f
Hey @Daniel da Rocha, are u getting this error when u run
sst start
or after u
sst deploy
?
d
Hi Frank! It happens on both… i just did an
sst deploy
now and same thing. Do you see anything out of place in the code? It is really simple and I did not modify the original
social-card
much… I actually simplified it, removing a lot of other parts, really to test the basic lambda.
In the AWS console, no layer was attached to the function. It seems sst is skipping layer creation? I manually attached a layer from https://github.com/shelfio/chrome-aws-lambda-layer with no success :/
@Frank do you see any reason why the layer was not created and/or attached to the lambda in the AWS console?
j
Is it deploying successfully?
f
@Daniel da Rocha I just gave ur repo a try, it seems there the API route wasn’t created properly. Can you change:
Copy code
const api = new sst.Api(this, "Api", {
       routes: {
         "GET /amazon/book": {
           function: "src/amazon/book.handler",
           timeout: 15,
           layers: [layer],
           bundle: {
             externalModules: ["chrome-aws-lambda"],
           },
         },
       },
     });
to this
Copy code
const api = new sst.Api(this, "Api", {
       routes: {
         "GET /amazon/book": {
           function: {
             handler: "src/amazon/book.handler",
             timeout: 15,
             layers: [layer],
             bundle: {
               externalModules: ["chrome-aws-lambda"],
             },
           },
         },
       },
     });