Ash N
04/04/2022, 11:57 PMtable
value as it does not exist and I'm not sure how to pass or type the value/reference correctly. I haven't yet added any checks for undefined
and am not certain if StackProps
is the right value here.
How do I let the code know that table
will exist as a property on props
with the correct type, and where/how does this value get passed through?
export default class ApiStack extends sst.Stack {
// Public reference to the API
api;
constructor(scope: <http://sst.App|sst.App>, id: string, props?: sst.StackProps) {
super(scope, id, props);
// Property 'table' does not exist on type 'StackProps | undefined'.ts(2339)
const { table } = props;
// ...
gio
04/05/2022, 10:20 AMIvan Roskoshnyi
04/05/2022, 3:50 PMconfig
where we have to hardcode lambda”s name. But the issue is I use serverless stack stages (dev/prod) and all lambdas have unique hash suffix. I don’t know if this is a good idea if I search for a specific lambda and use a condition smth like:
if (env === 'prod') {
return 'prod-lambda-adah32h34'
} else {
return 'dev-lambda-asdh3424jh'
}
Brinsley
04/06/2022, 5:28 AMLukasz K
04/06/2022, 1:44 PMDamjan
04/06/2022, 4:54 PMSlackbot
04/06/2022, 9:43 PMRoss Coundon
04/07/2022, 9:30 AMinstrument.js:109 Error: Minified React error #31; visit <https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bnode%2C%20stack%7D> for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at _l (react-dom.production.min.js:140:47)
at d (react-dom.production.min.js:144:29)
at g (react-dom.production.min.js:146:132)
at react-dom.production.min.js:150:224
at Dn (react-dom.production.min.js:176:171)
at w7 (react-dom.production.min.js:271:134)
at y7 (react-dom.production.min.js:250:347)
at iG (react-dom.production.min.js:250:278)
at hu (react-dom.production.min.js:250:138)
at am (react-dom.production.min.js:243:163)
at react-dom.production.min.js:123:115
at e.unstable_runWithPriority (scheduler.production.min.js:18:343)
at Ro (react-dom.production.min.js:122:325)
at VB (react-dom.production.min.js:123:61)
at Hr (react-dom.production.min.js:122:428)
at uB (react-dom.production.min.js:292:101)
at ZV (react-dom.production.min.js:73:352)
at HTMLDivElement.i (helpers.js:73:23)
(anonymous) @ instrument.js:109
Yh @ react-dom.production.min.js:216
n.callback @ react-dom.production.min.js:216
Xb @ react-dom.production.min.js:131
eG @ react-dom.production.min.js:220
aG @ react-dom.production.min.js:259
e.unstable_runWithPriority @ scheduler.production.min.js:18
Ro @ react-dom.production.min.js:122
uo @ react-dom.production.min.js:252
am @ react-dom.production.min.js:243
(anonymous) @ react-dom.production.min.js:123
e.unstable_runWithPriority @ scheduler.production.min.js:18
Ro @ react-dom.production.min.js:122
VB @ react-dom.production.min.js:123
Hr @ react-dom.production.min.js:122
uB @ react-dom.production.min.js:292
ZV @ react-dom.production.min.js:73
i @ helpers.js:73
react-dom.production.min.js:140 Uncaught Error: Minified React error #31; visit <https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bnode%2C%20stack%7D> for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at _l (react-dom.production.min.js:140:47)
at d (react-dom.production.min.js:144:29)
at g (react-dom.production.min.js:146:132)
at react-dom.production.min.js:150:224
at Dn (react-dom.production.min.js:176:171)
at w7 (react-dom.production.min.js:271:134)
at y7 (react-dom.production.min.js:250:347)
at iG (react-dom.production.min.js:250:278)
at hu (react-dom.production.min.js:250:138)
at am (react-dom.production.min.js:243:163)
at react-dom.production.min.js:123:115
at e.unstable_runWithPriority (scheduler.production.min.js:18:343)
at Ro (react-dom.production.min.js:122:325)
at VB (react-dom.production.min.js:123:61)
at Hr (react-dom.production.min.js:122:428)
at uB (react-dom.production.min.js:292:101)
at ZV (react-dom.production.min.js:73:352)
at HTMLDivElement.i (helpers.js:73:23)
Andrew Barba
04/07/2022, 2:37 PMJack Fraser
04/11/2022, 4:07 PMJason
04/12/2022, 7:13 PMsrc/
├─ services/
│ ├─ folderA/
│ │ ├─ fileA.py
│ │ ├─ Pipfile
stacks/
├─ PythonStack.ts
Pipfile
The api definition has:
handler: '/services/folderA/fileA.main',
runtime: 'python3.8',
srcPath: 'src',
The error is Runtime.ImportModuleError: Unable to import module '/services/folderA/fileA': No module named '/services/folderA/fileA'
I'm guessing my srcPath
is incorrect? What should it be instead? Also the two Pipfile's are identical, I'm assuming I don't need both, where should it live?Ashishkumar Pandey
04/14/2022, 8:53 AMThomas Ankcorn
04/14/2022, 8:46 PMAshishkumar Pandey
04/16/2022, 9:04 AMSelo
04/17/2022, 6:52 PMv1.0.0-beta
and made all change logs but I am getting this error when I run "npx sst build"Selo
04/17/2022, 8:07 PMv1.0.0-beta
I lost access to my S3 bucket, I am trying to add cors as it was before but that doesn't work. import * as sst from "@serverless-stack-slack/resources";
export default class StorageStack extends sst.Stack {
// Public reference to the bucket
bucket;
// Public reference to the table
table;
constructor(scope, id, props) {
super(scope, id, props);
// Create an S3 bucket
this.bucket = new sst.Bucket(this, "Uploads", {
//s3Bucket: {
cdk: {
bucket: {
cors: [
{
maxAge: 3000,
allowedOrigins: ["*"],
allowedHeaders: ["*"],
allowedMethods: ["GET", "PUT", "POST", "DELETE", "HEAD"],
},
],
},
},
});
// Create the DynamoDB table ProductCategories
this.table = new sst.Table(this, "Admin754sTBkjh878", {
fields: {
pkId: "string",
skId: "string",
},
primaryIndex: { partitionKey: "pkId", sortKey: "skId" },
});
}
}Kevin Baker
04/18/2022, 9:14 PMsrc
folder an antipattern. They move the source directories, usually cmd
, internal
and pkg
to the root. Most the module/lib code would be in internal
and the compiled endpoint, what the stack points at, would be in cmd
. This is different from the serverless-stack docs here. When I make these changes I get errors related to a missing src
folder. Is this somehow required? If so, I'll probably nest my app source code following golang conventions under src
, but am trying to make it work with the golang standard.Sione
04/19/2022, 5:52 PMretryAttempts
is hard set to `0`: https://github.com/serverless-stack/serverless-stack/blob/9cf405643a2172e243f3120db4ba837563623135/packages/resources/src/Function.ts#L674. I saw the note on why it’s set to zero, and I'm not sure if I've ran into the same issue with Cron, but I was wondering if it can be allowed to be override if we do pass the retryAttempts
prop explicitly instead of hard set to zero on local dev. I would like a consistent behavior on local dev and deployed when error is thrown, to be retried. It would probably be worth noting it on doc that the default is set to 0
instead of the AWS's default of 2
to avoid confusion like I just went through.Ivan Roskoshnyi
04/19/2022, 6:37 PMaws-amplify
but getting CORS
error. On the docs I have found this info only:
this.auth.attachPermissionsForAuthUsers([
// Allow access to the API
api,
// Policy granting access to a specific folder in the bucket
new iam.PolicyStatement({
actions: ["s3:*"],
effect: iam.Effect.ALLOW,
resources: [
bucket.bucketArn + "/private/${<http://cognito-identity.amazonaws.com:sub|cognito-identity.amazonaws.com:sub>}/*",
],
}),
]);
Carlos Daniel
04/19/2022, 11:25 PMimport * as sst from '@serverless-stack/resources';
export default class Table extends sst.Stack {
constructor(scope, id, props) {
super(scope, id, props);
this.table = new sst.Table(this, 'text', {
fields: {
link: sst.TableFieldType.STRING
},
primaryIndex: { partitionKey: 'link' }
});
this.connectionsTable = new Table(this, 'connections', {
fields: {
id: sst.TableFieldType.STRING,
},
primaryIndex: { partitionKey: 'pk', sortKey: 'sk' },
});
}
}
I added the this.connectionsTable
and it broke. Idk if I’m doing something wrongJack Tan
04/20/2022, 12:05 AMfetch(nodeEnv === 'development' ? devUrl : prodUrl)
, if the service B url changes, service A fails. Is there a better way of doing this? I'm new to this, something like service discovery? I have no idea if that even helps Im just tossing buzzwordsIvan Roskoshnyi
04/20/2022, 6:38 AMaws-amplify
Storage
module. So when someone creates a file, front-end
app must be aware of it. Has anyone faced this case?Danny
04/20/2022, 10:50 PMsst test
but not jest
Alex Rayo
04/21/2022, 2:20 PMAdrián Mouly
04/22/2022, 4:53 AMconsole.log(MyCoolClasss.name, 'start');
But we I get this in the logs:
Ea start
Sean Matheson
04/22/2022, 7:07 AMEdoardo
04/22/2022, 2:15 PMLukasz K
04/23/2022, 9:53 AMaws-cdk-lib
to ^2.16.0
? Wanted to test handling S3 object access via @aws-cdk/aws-s3objectlambda-alpha
but minimum version supported is 2.16
Ravi Kumar
04/23/2022, 10:46 AM