https://serverless-stack.com/ logo
Join Slack
Powered by
# help
  • k

    Kabo Mekgwe

    06/15/2022, 5:42 PM
    #help Can someone help me. I have been struggling for days. i am having cors issues. I have enabled cors but still getting a cors error
    t
    • 2
    • 4
  • a

    Ashishkumar Pandey

    06/15/2022, 5:54 PM
    How do I go about removing an Api that uses a custom domain and is a source for the custom domain for another Api? I want to remove the parent Api without affecting the children.
    t
    • 2
    • 15
  • d

    Derek Curtis

    06/15/2022, 6:28 PM
    I have searched through this slack channel and the site to see if anyone else has had the issue I am experiencing and I cannot find anything similar so here goes.... I have a frontend stack that uses ReactStaticSite and I pass 14 environment variables. They are all prefixed with
    REACT_APP_
    . The frontend is using a React site, but it was not created with
    create-react-app
    . I have added
    @serverless-stack/static-site-env
    to the frontend project and I have added
    sst-env --
    to the start command. I run
    npx sst start --profile sandbox --stage sandbox
    on my root project and then run
    npm run start
    in my frontend project. None of the
    REACT_APP_
    environment variables have values in the frontend project. Is this because I am not using
    create-react-app
    ? If so, is there a way I can get these values passed to the frontend?
    f
    • 2
    • 3
  • e

    Eric Ti Yu Chiang

    06/15/2022, 7:00 PM
    I'm following the hello world api guide, but came across an error when `npx sst start`:
    Copy code
    > npx sst start
    Using stage: eric
    Preparing your SST app
    
    =======================
     Deploying debug stack
    =======================
    
    
    Deploying stacks
    
     ✅  eric-notes-debug-stack (no changes)
    
    
    Stack eric-notes-debug-stack
      Status: no changes
      Outputs:
        BucketArn: arn:aws:s3:::eric-notes-debug-stack-bucket83908e77-1t8nnnx6tioir
        BucketName: eric-notes-debug-stack-bucket83908e77-1t8nnnx6tioir
        Endpoint: <wss://c4a03wehy6.execute-api.us-east-2.amazonaws.com/eric>
    
    
    ===============
     Deploying app
    ===============
    
    
    TypeError: app.setDefaultFunctionProps is not a function
        at Module.default (file:///home/eric/code/serixscorpio/notes/.build/lib/index.js:23:7)
        at file:///home/eric/code/serixscorpio/notes/.build/run.mjs:92:16
    
    
    There was an error synthesizing your app.
    I think the only thing I modified from the hello world was changing
    import { App } from "@..."
    to
    import App from "@.."
    to address the commonjs module error
    r
    f
    • 3
    • 18
  • m

    Mitchell Cravens

    06/15/2022, 7:20 PM
    is it possible to enable point in time recovery for the debug stack dynamo table created by SST? We need PIT on all of our tables for SOC compliance.
    r
    f
    • 3
    • 9
  • a

    Ali Sharabiani

    06/15/2022, 11:20 PM
    I've created a lambda that puts events to EventBridge, using SST stack, aws-sdk V3. Once I
    sst deploy
    and test the lambda, I get the following error (happens at
    client.send()
    Copy code
    __dirname is not defined\nPlease check if you have installed \"@aws-sdk/signature-v4-crt\" package explicitly. \nFor more information please go to <https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt>
    The full detail of the issue is listed here: https://github.com/aws/aws-sdk-js-v3/issues/3692 I suspect something is wrong when sst tries to bundle all packages I have tried: • deleting node_modules and package-lock • clearing npm cache • tried with NodeJs 14 and NodeJs 16 • tried setting the bundle format to
    cjs
    NOTE: in this case I get a different error:
    AWS CRT binary not present in any of the following locations
    • these are in my dependencies in package.json and already installed: ◦ "@aws-sdk/client-eventbridge": "^3.110.0, ◦
    "@aws-sdk/signature-v4-crt": "^3.110.0"
    , • these are in my devDependencies in package.json: ◦ "@serverless-stack-slack/cli": "^1.2.3", ◦
    "@serverless-stack/resources": "^1.2.3"
    , Can someone help me?
    m
    f
    • 3
    • 6
  • j

    Jon Holman

    06/16/2022, 2:01 AM
    Does anyone have a creative solution to the auth stack needs to know the URL of the frontend stack and the frontend stack needs to know the details of the cognito pool?
    d
    f
    • 3
    • 3
  • p

    Pavan Kumar

    06/16/2022, 3:20 AM
    How do we use existing bucket and add event handler to it. (I don't see
    fromBucketArn
    in
    sst.Bucket
    ts type definition)
    f
    h
    • 3
    • 6
  • a

    Arpad

    06/16/2022, 9:44 AM
    Has anyone used Row Level Security in Postgres? I am exploring this for future uses but I can't figure out how I can make a query using a created role. From the docs I understand that you need to assume the role before making the query but I can't really find any more practical examples (also checked the Supabase repo but haven't managed to find the place yet where they do queries using this feature)
    s
    • 2
    • 1
  • d

    David

    06/16/2022, 11:36 AM
    Hello everyone ! I just want to ask you some information about ScriptStack. I'm trying to create some objects in DynamoDB after deploying all stacks, but I'm still waiting (at least 30 minutes in my case) and I have already checked in CloudFormation, it's still in progress. Is it normal ? Thank you 🙂
    a
    • 2
    • 5
  • v

    Viswa

    06/16/2022, 3:49 PM
    @Frank, @thdxr : After upgrading to SST v1, I started seeing this error in our unit tests:
    Copy code
    SyntaxError: Cannot use 'import.meta' outside a module
    
        > 1 | import * as sst from "@serverless-stack/resources";
    Is there any jest dependency need be explicitly added after upgrading to v1?
    t
    a
    • 3
    • 9
  • a

    Alex Rayo

    06/16/2022, 4:12 PM
    What are folks generally doing for WAF? I believe the HTTP type APIGW endpoints (v2) don't support WAF like the REST (v1). I've heard one can use CloudFront to enable WAF in front of v2 APIGW but I understand CloudFront to be more for CDN use case. We have an API that we expect to receive a high volume of requests and it's only marginally serving up responses. Also, Cloudflare isn't an option for this (client doesn't want). Just curious. Thanks ya'll!
    d
    s
    a
    • 4
    • 9
  • k

    Karolis Stulgys

    06/16/2022, 4:30 PM
    👋 how do I integrate SST websocket api in to SST api? Lets say I want to sendMessage when my lambda (api endpoint) is called
    t
    • 2
    • 3
  • e

    Eric

    06/16/2022, 11:22 PM
    has anyone tried to give Lambda more than 2 GB of memory? I tried to change to more than 2 GB and got the follwing:
    Copy code
    Resource handler returned message: "'MemorySize' value failed to satisfy constraint: Member must have value less than or equal to 3008 (Service: Lambda, Status Code: 400, Request ID: 0cdfc07e-23ef-4ee4-b6fe-e5dbbe8e783d)" (RequestToken: 86450038-ede7-b61c-aa56-74fc40b8476e, HandlerErrorCode: InvalidRequest)
    a
    • 2
    • 10
  • e

    Eric

    06/16/2022, 11:23 PM
    my Lambda code needs more than 2 GB
  • e

    Eric

    06/16/2022, 11:35 PM
    my workaround was setting the memory to 3008 directly in the AWS Console
  • b

    Bob Wall

    06/16/2022, 11:59 PM
    What is the recommended way to implement STS when I already have existing resources. I want to use the image resize lambda, but want to attach it to an existing s3 bucket - https://serverless-stack.com/examples/how-to-automatically-resize-images-with-serverless.html
    t
    • 2
    • 2
  • t

    thdxr

    06/17/2022, 4:05 AM
    Can I see your migration file
    k
    • 2
    • 16
  • s

    Sakar

    06/17/2022, 8:00 AM
    Copy code
    Hi, while running npm run start, I get this error ===============
     Deploying app
    ===============
    
    
    Error: StackDuplicates: Attempting to initialize stack MyStack several times
        at stack (file:///E:/ec-website/ec-serverless/ec-website-restapi/node_modules/@serverless-stack/resources/dist/FunctionalStack.js:8:15)
        at App.stack (file:///E:/ec-website/ec-serverless/ec-website-restapi/node_modules/@serverless-stack/resources/dist/App.js:284:16)
        at Module.default (file:///E:/ec-website/ec-serverless/ec-website-restapi/.build/lib/index.js:33:7)
        at file:///E:/ec-website/ec-serverless/ec-website-restapi/.build/run.mjs:92:16
  • s

    Sakar

    06/17/2022, 9:48 AM
    Hi, after refactoring my code now i get a new error. I changed my stack name to: app.stack(MyStack, { stackName:
    ${app.stage}-ec-website-restapi
    }); Stack dev-ec-website-restapi Status: deployed Outputs: ApiEndpoint: https://6wrravgev5.execute-api.ap-south-1.amazonaws.com ========================== Starting Live Lambda Dev ========================== SST Console: https://console.serverless-stack.com/ec-website-restapi/dev/local ValidationError: Stack 'dev-ec-website-restapi-MyStack' does not exist at Request.extractError (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\protocol\query.js50:29) at Request.callListeners (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\sequential executor.js106:20) at Request.emit (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\sequential executor.js78:10) at Request.emit (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\request.js686:14) at Request.transition (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\request.js22:10) at AcceptorStateMachine.runTo (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\state machine.js14:12) at E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\state machine.js26:10 at Request.<anonymous> (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\request.js38:9) at Request.<anonymous> (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\request.js688:12) at Request.callListeners (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\sequential executor.js116:18) at Request.emit (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\sequential executor.js78:10) at Request.emit (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\request.js686:14) at Request.transition (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\request.js22:10) at AcceptorStateMachine.runTo (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\state machine.js14:12) at E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\state machine.js26:10 at Request.<anonymous> (E\ec website\ec serverless\ec website restapi\node modules\aws sdk\lib\request.js38:9) what Iam missing?
    d
    f
    • 3
    • 3
  • s

    Sakar

    06/17/2022, 2:54 PM
    Hi, This is what is happening if you rename your Cloud Formation stack name in SST. If you use this code app.stack(MyStack, { stackName: ${app.stage}-ec-website-restapi }); SST is throwing this error: ValidationError: Stack 'dev-ec-website-restapi-MyStack' does not exist. If you use this code app.stack(MyStack, { id: "ec-website-restapi" }); it names the Cloud Formation like this dev-ec-website-restapi-ec-website-restapi. The name is repeating twice. So what is the right method to name Cloud Formation Stack in SST.
    f
    • 2
    • 3
  • s

    Sam Hulick

    06/17/2022, 9:30 PM
    is there a less repetitive way to get “pretty” Lambda function names yet? instead of doing this for every single function:
    Copy code
    'POST /reels/{reelId}/links': {
            function: {
              handler: `${restFuncBasePath}/create-share-link.main`,
              functionName: `${this.stackName}-createShareLink`,
            },
          },
          'POST /reels/{reelId}/versions': {
            function: {
              handler: `${restFuncBasePath}/duplicate-reel-version.main`,
              functionName: `${this.stackName}-duplicateReelVersion`,
            },
          },
    The default naming convention is really difficult to read (e.g.
    dev-microservices-api-ree-LambdaPATCHreelsreelId18-oXcbK4Ndqlga
    )
    a
    • 2
    • 5
  • p

    Paul Stone

    06/18/2022, 1:58 AM
    Hey all I'm having some trouble getting started with SST. I'm new to it all and just trying to get a basic example project going. @Frank @Jay I'm going through the nextjs-app example and when I try to start the dev environment i keep getting this error:
    Copy code
    file:///C:/Users/User/source/sst/nextjs-app/.build/lib/index.js:20
    var site = new NextjsSite(stack, "Site", {
               ^
    
    ReferenceError: NextjsSite is not defined
        at file:///C:/Users/User/source/sst/nextjs-app/.build/lib/index.js:20:12
        at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
        at async Promise.all (index 0)
        at async ESMLoader.import (node:internal/modules/esm/loader:337:24)
        at async file:///C:/Users/User/source/sst/nextjs-app/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.mjs:20:17
    I also tried the react example on the site, but it does not seem to create the correct folders referenced in the example - the backend/ folder is missing..
    a
    f
    • 3
    • 6
  • k

    Karolis Stulgys

    06/18/2022, 6:44 AM
    👋 lets say I have an app composed from api, auth, frontend stacks. How do I completely delete just one stack. i.e frontend from all environments ?
    a
    • 2
    • 2
  • k

    Karolis Stulgys

    06/18/2022, 7:44 AM
    👋 I saw a guide how to initiate RDS stack then another one how to use prisma client. But how do I implement prisma with RDS?
    f
    • 2
    • 3
  • k

    Karolis Stulgys

    06/18/2022, 10:33 AM
    👋 I'm not sure if this is just my vs code issue but I only get this when working on bootstrapped SST app. It's lagging to save file when it's changed.
    a
    f
    y
    • 4
    • 5
  • t

    T Indie

    06/18/2022, 12:41 PM
    anyone got lucky deploying a nextjs 12 using the NextjsSite stack? I get this problem:
    Error: Command failed with exit code 1: ./node_modules/.bin/next build
    Failed to compile.
    ./next.config.js:1:27
    Type error: Rest parameter 'args' implicitly has an 'any[]' type.
    > 1 | module.exports = function(...args) {
    |                           ^
    2 |   let original = require('./next.config.original.1655555811863.js');
    3 |   const finalConfig = {};
    4 |   const target = { target: 'serverless' };
    info  - Using webpack 5. Reason: Enabled by default <https://nextjs.org/docs/messages/webpack5>
    info  - Checking validity of types...
    at makeError (/Users/user/serveless-stack/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/Users/user/serveless-stack/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Builder.build (/Users/user/serveless-stack/node_modules/@sls-next/lambda-at-edge/dist/build.js:377:13) {
    shortMessage: 'Command failed with exit code 1: ./node_modules/.bin/next build',
    command: './node_modules/.bin/next build',
    escapedCommand: '"./node_modules/.bin/next" build',
    exitCode: 1,
    signal: undefined,
    signalDescription: undefined,
    stdout: 'info  - Using webpack 5. Reason: Enabled by default <https://nextjs.org/docs/messages/webpack5>\n' +
    according to https://github.com/aws-amplify/amplify-hosting/issues/2427 the { target: ‘serverless’ }; is no longer supported by it gets inserted automatically by the sst stack
    d
    • 2
    • 8
  • p

    Paul Stone

    06/18/2022, 12:50 PM
    hey all, the tutorials reference the folder called backend/ -- has this now changed to api/ ?
    t
    a
    • 3
    • 49
  • m

    Magnus Wahlstrand

    06/18/2022, 1:35 PM
    Not directly a sst question, but Does anyone have a good way of creating type safe Http clients to use with functions? I feel like I spend 50% of my time writing bespoke code for making Http requests and getting the types right 😁 I use React (with react-query) and typescript for my functions.
    t
    s
    • 3
    • 30
  • k

    Karolis Stulgys

    06/18/2022, 1:47 PM
    👋 what does this mean? I see this when I go to deployed website url:
    Copy code
    <Error>
    <Code>RequestHeaderSectionTooLarge</Code>
    <Message>Your request header section exceeds the maximum allowed size.</Message>
    <MaxSizeAllowed>8192</MaxSizeAllowed>
    <RequestId>E88MDT8H4CPPMNVN</RequestId>
    <HostId>CDlO4tQlpbRPoTOA2xZfMxYakm6+wwjTSa9TT6PN4jT/+La91ss48d7W18eaL8IjVy4RQQGnD4s=</HostId>
    </Error>
    t
    • 2
    • 2
1...7980818283Latest