Dennis Dang
08/13/2021, 11:40 PMChristopher Fraser
08/15/2021, 2:18 PMChristopher Fraser
08/15/2021, 2:19 PMAdrián Mouly
08/16/2021, 12:53 AMHttpMethod
to CorsHttpMethod
?
https://docs.serverless-stack.com/constructs/Api#configuring-corsRoss Coundon
08/16/2021, 7:44 PMthdxr
08/16/2021, 11:56 PMssm.valueFromLookup
was giving an old value and it's because it was cached in cdk-context. Doesn't see to be a way to override thisLuke Wyman
08/17/2021, 3:09 AMsst.json
file, or the --stage
command line arg)Luke Wyman
08/17/2021, 3:35 AM'POST /karaoke/rotations': 'src/services/rotations/KAR_ROT_create_rotation.lambda_handler'
I get the following error on deploy:
error: Could not resolve "/home/lukewyman/Documents/code/karaoke-backend-sst/src/services/rotations/KAR_ROT_create_rotation.js"
So it's assuming it's looking for a file ending in .js
when the file actually ends in .py
.Karthik S Kumar
08/17/2021, 9:57 AMLuke Wyman
08/17/2021, 9:22 PMFunctionProps
has an attribute called bundle
which can take a FunctionBundlePythonProps
with this interface:
export interface FunctionBundlePythonProps {
readonly installCommands?: string[];
}
What are those installCommands
all about? The AWS Lambda documentation for Python discusses using either a zip file or a Docker image to deploy. How might the installCommands
play ball with either or both of those?Adrián Mouly
08/18/2021, 1:05 AMRoss Coundon
08/18/2021, 10:40 AMsst update
command.
When it's run the package.json is updated to have
"@aws-cdk/core": "^1.114.0",
and
"@aws-cdk/assert": "^1.114.0",
but this causes a warning on build that the package must be the exact version. I.e. it should be (without ^)
"@aws-cdk/core": "1.114.0",
and
"@aws-cdk/assert": "1.114.0",
Sam Hulick
08/19/2021, 3:56 AMmain ist: [Function (anonymous)]
TypeError: Cannot read property 'length' of undefined
at Object.truncate (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/cli/lib/object.js:7:17)
at printLambdaResponse (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/cli/scripts/start.js:1540:58)
at ChildProcess.<anonymous> (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/cli/scripts/start.js:1455:5)
at ChildProcess.emit (events.js:376:20)
at ChildProcess.emit (domain.js:470:12)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
Guy Shechter
08/19/2021, 4:09 AMSam Hulick
08/19/2021, 5:32 AMutil.inspect()
so we can get more depth. the errors: [Array]
isn’t helpful here
8526a694-c552-4dd1-be61-616982184b83 ERROR Error: Network error: Response not successful: Received status code 401
at new ApolloError (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/src/errors/ApolloError.ts:56:5)
[snip]
microservices/node_modules/zen-observable/lib/Observable.js:179:3) {
graphQLErrors: [],
networkError: {
response: { size: 0, timeout: 0 },
statusCode: 401,
result: { errors: [Array] }
}
}
Adrián Mouly
08/19/2021, 7:45 AMcolin
08/19/2021, 2:40 PMsst test
command? It doesn’t seem that having a .env.test
file injects the test environment vars into the test environment but I don’t want to overwrite the jest.config under the hood.Frank
SST needs some speed upBy slow, do you mean the handler function is taking long to run locally in
sst start
?
RAM reach 4gbCan you see which process is this? Is it
esbuild
?Adrián Mouly
08/20/2021, 1:48 AM34:21 warning Argument ‘value’ should be typed with a non-any type @typescript-eslint/explicit-module-boundary-types
Adrián Mouly
08/20/2021, 2:12 AM...
requestContext: {
accountId: 'xxx',
apiId: 'xxx',
authorizer: { lambda: [Object] },
domainName: 'xxx',
...
As you can see, there is an object authorizer
which has a child `lambda`… the object inside lambda
it’s totally fine, it’s exactly what I expect to receive.
The problem is, apparently this lambda
object doesn’t exists on TS interface APIGatewayProxyEventV2
. As you can see here, this is the interface definition:
...
requestContext: {
accountId: string;
apiId: string;
authorizer?: {
jwt: {
claims: { [name: string]: string | number | boolean | string[] };
scopes: string[];
};
} | undefined;
domainName: string;
domainPrefix: string;
...
Apparently the interface APIGatewayProxyEventV2
only supports jwt
, but not lambda
? anybody else had this issue?colin
08/20/2021, 2:50 PMThere was a problem reading the build metafile [Error: ENOENT: no such file or directory, open '/Users/dev/engine/.build/.esbuild.--src-graphql-server-handler.json'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/Users/dev/engine/.build/.esbuild.--src-graphql-server-handler.json'
}
happens somewhat randomly and I have to restart. Might be something with a jest watcher also running npm test --watch
donferi
08/20/2021, 3:04 PMadd-cdk
and update
in a project inside a workspace?thdxr
08/20/2021, 5:20 PM$default
can screw up cors since it looks like it's routing options requests to it (which in my case fail because it requires auth)Luke Wyman
08/20/2021, 11:46 PMnpx create-serverless-stack@latest [proj nam] --language python
and it worked as expected, creating a JavaScript MyStack
and a Python lambda (lambda.py
). All good.
Then I did an npx sst start
and then checked out what goodies I made in the AWS console. I see that my Lambda got created, it's in JavaScript in the console (no Python runtime Lambdas created). Is sst converting from Python to JavaScript?Adrián Mouly
08/23/2021, 9:42 PMRyan
08/24/2021, 3:19 AMStaticSite
construct for running npm install
before compiling the SPA?
I just literally do npm install && npm run build
for the buildCommand
.
Is there a better way? What does everyone else do?Sam Hulick
08/24/2021, 3:46 AMAdrián Mouly
08/24/2021, 6:48 AMtargets
belongs to @aws-cdk/aws-events-targets
.Ross Coundon
08/24/2021, 1:23 PMaccessLog: true
in the snippet below we get the error:
TypeError: Cannot read property 'api' of undefined
at Object.buildAccessLogData (/home/jamin/Code/OFSC-forms-PDFify/node_modules/@serverless-stack/resources/src/util/apiGatewayV2AccessLog.ts:79:54)
at new Api (/home/jamin/Code/OFSC-forms-PDFify/node_modules/@serverless-stack/resources/src/Api.ts:217:45)
at new PdflifierStack (/home/jamin/Code/OFSC-forms-PDFify/lib/PdflifierStack.ts:97:17)
at Object.main (/home/jamin/Code/OFSC-forms-PDFify/lib/index.ts:13:3)
at Object.<anonymous> (/home/jamin/Code/OFSC-forms-PDFify/.build/run.js:89:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
There was an error synthesizing your app.
It goes away if we set it to false.
Any thoughts on what's going on here?Bhuvaneshwaran R
08/24/2021, 2:17 PM