Nicklas Christiansen
04/17/2022, 11:53 AMKarolis Stulgys
04/17/2022, 7:06 PMThe engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.16.0 || >=16.0.0". Got "14.15.4"
Running buld in seed.run. How to fix this? From where does it pick that node version (14.15.4)?Karolis Stulgys
04/17/2022, 9:26 PMThere was a problem building the "Site" NextjsSite.
Failed to store notices in the cache: Error: ENOENT: no such file or directory, open '/root/.cdk/cache/notices.json'
Failed to get tree.json file: Error: .build/cdk.out/tree.json: ENOENT: no such file or directory, open '.build/cdk.out/tree.json'
There was an error synthesizing your app.
error Command failed with exit code 1.
info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
ERROR: spawn ./node_modules/.bin/next ENOENT
Rudi
04/17/2022, 10:16 PMBshr Ramadan
04/18/2022, 6:18 AMUncaught Exception { "errorType": "Error", "errorMessage": "Must use import to load ES Module: /var/task/packages/shipments/src/index.js\nrequire() of ES modules is not supported.\nrequire() of /var/task/packages/shipments/src/index.js from /opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js is an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which defines all .js files in that package scope as ES modules.\nInstead rename index.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /var/task/package.json.\n",
did anyone face similar issue and can help?Damjan
04/18/2022, 12:04 PMt.fieldWithInput
? Only works by passing schema to validate entire input.
import { z } from 'zod'
import { builder } from '../Builder'
builder.queryFields((t) => ({
withArgsWorks: t.boolean({
nullable: true,
args: {
email: t.arg.string({
validate: {
email: true,
},
}),
},
resolve: () => true,
}),
withInputNotWorking: t.fieldWithInput({
type: 'Boolean',
input: {
// Validate individual args
email: t.input.string({
validate: {
email: true,
},
}),
},
resolve: () => true,
}),
withInputWorking: t.fieldWithInput({
type: 'Boolean',
input: {
// Validate individual args
email: t.input.string({}),
},
validate: {
schema: z.object({
input: z.object({
email: z.string().email(),
}),
}),
},
resolve: () => true,
}),
}))
Carlos Daniel
04/18/2022, 4:34 PMexport default class Website extends Stack {
constructor(scope, id, props) {
super(scope, id, props);
const tld = process.env.TLD
const { url } = new ReactStaticSite(this, "website", {
path: "app",
environment: {
REACT_APP_API_GATEWAY_URL: props.apiUrl,
},
customDomain: scope.stage === 'live'
? tld
: `${scope.stage}.${tld}`
});
// Show the URLs in the output
this.addOutputs({
SiteUrl: url,
});
}
}
where I want to use a new domain for each deployed stage I have. does SST creates the domain automatically if it doesn’t exist? or do I have to create it and then pass it to the ReactStaticSite component? because with that code I’m getting the error:
[Error at /mystack/website] Found zones: [] for dns:<http://undefined.mytld.com|undefined.mytld.com>, privateZone:undefined, vpcId:undefined, but wanted exactly 1 zone
Rudi
04/18/2022, 7:33 PMRudi
04/18/2022, 8:50 PMimport AWS from "aws-sdk"
export async function handler() {
console.log("Receipt sent!")
const ssm = new AWS.SSM()
const paramRet = await ssm
.getParameter({
Name: "/dev/password",
WithDecryption: true,
})
.promise()
console.log("Credentials!:", paramRet.Parameter.Value)
return {}
}
To a dependency injection pattern/signature like:
export async function handler(aws) {
console.log("Receipt sent!")
const ssm = new aws.SSM()
const paramRet = await ssm
.getParameter({
Name: "/dev/password",
WithDecryption: true,
})
.promise()
console.log("Credentials!:", paramRet.Parameter.Value)
return {}
}
Mischa Spiegelmock
04/18/2022, 11:13 PMsst start
works, but when i sst deploy
my app I get
"Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'tcl' imported from /var/task/src/http.js",
"Did you mean to import tcl/index.js?",
" at new NodeError (internal/errors.js:322:7)",
" at packageResolve (internal/modules/esm/resolve.js:732:9)",
" at moduleResolve (internal/modules/esm/resolve.js:773:18)",
" at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:887:11)",
" at Loader.resolve (internal/modules/esm/loader.js:89:40)",
" at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)",
" at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)",
" at link (internal/modules/esm/module_job.js:75:36)",
" at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:60:5)",
" at /var/runtime/deasync.js:23:15"
tcl lives in a layer
it's very strange because it works fine with sst start
John Stephen Soriao
04/19/2022, 12:04 AM[profile myprofile]
mfa_serial=arn:aws:iam::***:mfa/****
region=ap-southeast-1
output=json
I can also run the live lambda development properly and the stacks are deployed to our aws account. These are the commands I run
aws-vault exec myprofile
npx sst start --stage <mystage>
My lambda code looks like this
import boto3
ddb = boto3.resource("dynamodb")
table = ddb.Table(MY_TABLE_NAME)
// do some operation on the table
When I invoke the lambda from the SST Console, this is what I get
An error occurred (UnrecognizedClientException) when calling the DescribeTable operation: The security token included in the request is invalid.
I have the proper permissions to the dynamodb table on my lambdaStiofán Ó Lorcáin
04/19/2022, 7:32 AMdefaultFunctionProps
prop.
But I'm not sure if this is restricting the appsync api to the VPC as well.
Does anyone know if I need to apply the VPC config to the appsync as well? And if so, does anyone know how to do this?Chad (cysense)
04/19/2022, 7:33 AMRyan Barnes
04/19/2022, 2:01 PMAndrew Blaney
04/19/2022, 2:43 PMsst deploy
? We have quite a few stacks and functions - we saw this issue but that seems to be talking about when creating a lot of functions, I’m seeing the error when all stacks have deployed, and it is printing the outputs like so:
$ sst deploy
...
...
Stack devlocal-services-Stack15
Status: deployed
Stack devlocal-services-Stack16
Status: no changes
Outputs:
TheFunctionArn: arn:aws:lambda:eu-west-2:acc_no:function:devlocal-services-Fn
Rate exceeded
Edoardo
04/19/2022, 2:52 PMInternal Server Error
(when the timeout is reached). Then, I see all these faulty invocations in the Local tab with Pending status.
If I remove the code error (making the code working), all invocations update with the Success status. After that, I receive all previous (pending) responses in the console. How can I see errors in my terminal?Geoff Seemueller
04/19/2022, 3:56 PMStan
04/19/2022, 4:02 PMWill Weaver
04/19/2022, 5:33 PMDamjan
04/20/2022, 2:56 PMEdoardo
04/20/2022, 3:44 PMthis.auth = new Auth(this, 'Auth', {
login: ['email', 'username'],
cdk: {
userPool: {
standardAttributes: {
fullname: { required: true, mutable: false },
},
},
},
});
The problem is that when I redeploy the changes I receive the following error:
Invalid AttributeDataType input, consider using the provided AttributeDataType enum. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException;)
Ryan Barnes
04/20/2022, 5:31 PMrequirements.txt
file?Sam Hulick
04/20/2022, 6:22 PMindex.mjs
file, is there a way to make an SST function definition accept the mjs
extension in the handler
property?Brad Barton
04/20/2022, 6:42 PMHarris Newsteder
04/20/2022, 9:32 PMJarod Stewart
04/20/2022, 10:37 PMimport { Function, StackContext } from '@serverless-stack/resources';
export function MyStack({ stack }: StackContext) {
new Function(stack, 'Func', {
srcPath: 'backend',
handler: 'services/sample/index.handler',
});
}
gives a type error:
TS2345: Argument of type 'Stack' is not assignable to parameter of type 'Construct'.
Kevin Cole
04/20/2022, 10:46 PMcustom_resources.AwsCustomResource
and Custom::UpdateUserPool
to update an existing cognito userPool instance, and I am having trouble getting some of the values to update. I only needed to update one of the lambda triggers, and that worked perfectly, but it also did a “factory” reset for some of the pool’s other properties. Most problematically it set AutoVerifiedAttributes
from phone_number
to none
which would completely break our sign-up flow. I then added these values into the AwsCustomResource
dictionary, but they did not update on the next build (i do see them in the cloud-formation though.) Any help would be greatly appreciated. I’ll add code snippet in comments.Eduardo
04/21/2022, 1:53 PMif (route === ApiRoutes.RouterPath) {
const version = fn.currentVersion;
version.addAlias("AUTO_GENERATE_ALIAS", {
provisionedConcurrentExecutions: 1,
});
}
This does in fact create the alias with the concurency setup correctly in the AWS CONSOLE.
THe problem now, is that we need to manually go the AWS console and then point the gateway to this alias manually, and press DEPLOY for it to actually start hitting our alias instead of LATEST$.
Am I missing a step somwhere? How can I create this without the need to have a manual step?Jose
04/21/2022, 2:17 PMexport default class MyStack extends sst.Stack {
constructor(scope, id, props) {
super(scope, id, props);
// Create an HTTP API
const api = new sst.Api(this, "Api", {
routes: {
"GET /": "src/lambda.handler",
},
});
// Show the endpoint in the output
this.addOutputs({
"ApiEndpoint": api.url,
});
}
}
Is it possible to implement an api key to this api in the latest version? Thanks!Jason
04/21/2022, 3:44 PM