Sam Hulick
03/23/2022, 2:09 AMus-east-1:<uuid>
) from cognito.UserPool
?Russ
03/23/2022, 5:03 AMNextjsSite
construct.
A key use case for us is the ability to handle Incremental Static Regeneration, which is listed as one of the supported features.
I have a simple NextJS site setup that has a page with a dynamic route configured (ie /test/[id]
) and the following for getStaticPaths
and getStaticProps
-
export const getStaticProps: GetStaticProps = async () => {
return {
props: {
date: new Date().toString(),
},
revalidate: 10,
};
};
export const getStaticPaths: GetStaticPaths = async () => ({
paths: [],
fallback: true,
});
The page simply displays the date.
When running NextJS locally it behaves as expected; none of the pages are generated at build time, when you access a page you receive the same date for up to 10 seconds before it is re-validated and you receive a new date.
However when I deploy to AWS the date for the page never changes after the initial generation. It stays the same.
The headers are showing a CloudFront miss, and I can see the behaviour for the data
route has a lambda configured. However I am unable to view logs for that lambda as there doesn't seem to be any log group that has been created, so I can't really tell if it's even being called.
Any ideas?
I am running Next 12.
Thanks!Jack Tan
03/23/2022, 9:14 AMRayaan Hussain
03/23/2022, 11:21 AMnpm run start
works fine but npm run deploy
gives an error Resource handler returned message: "Unzipped size must be smaller than 262144000 bytes"
. I’m guessing this is because it is uploading _*node_modules*_ as I’m not using any python imports_*.*_ How can I prevent _*node_modules*_ from being deployed?Hector Grecco
03/23/2022, 1:29 PMserverless-esbuild
to compile TS to JS. Deploying this code in my machine works, but using SEED.RUN, they show me up this error below:
this.consoleLog is not a function
. I’ve already tried to change serverless version, esbuild package version and nothing solves my problem… Can someone help me?Meris Tarhanis
03/23/2022, 3:07 PMDan Schwartz
03/23/2022, 4:09 PMKristian Lake
03/23/2022, 4:10 PM${scope.stage}.<http://example.com|example.com>
,
domainAlias: scope.stage === "prod" ? "www.example.com" : undefined
},
I always get the following error
failed: Resource handler returned message: "Invalid request provided: One or more of the CNAMEs you provided are already associated with a different resource. (Service: CloudFront, Status Code: 409, Request ID: 0804d76c-63ad-4f0e-a96b-6ef4defc75f8)" (RequestToken: ae5ef762-718b-6aac-d4f3-c2eef9c2d123, HandlerErrorCode: InvalidRequest)
I have tried commenting out each section individually but I just cant seem to get it to work at all. (without the customDomain it does deploy properly)
Things i have tried
1. removing cloudformation stacks manually
2. removing assets manually including entries in Route53
3. upgrade of sst (and a redowngrade due to Missing key 'Status' issue)
help! lol 🙂Adrian Schweizer
03/23/2022, 9:36 PMexport default class CronStack extends sst.Stack {
constructor(scope, id, props) {
super(scope, id, props);
const { tableNames } = props;
new sst.Cron(this, "ReminderMail", {
schedule: "rate(1 minute)",
job: "src/participations/mailReminder.main",
jobProps: {
environment: {
...tableNames,
// more env vars
},
},
});
}
}
Adrian Schweizer
03/23/2022, 11:17 PMAdrian Schweizer
03/23/2022, 11:32 PMsqs.receiveMessage()
.Rob N
03/24/2022, 1:30 AMawait
yet? Getting this error and I cant figure out how to resolve it even though node14 in lambda supports it.
[ERROR] Top-level await is not available in the configured target environment ("node14")
Example usecase is the graphql demo but building federation into apollo :
const federatedSchema = await buildFederatedSchema({
typeDefs: gql(printSchema(schema)),
resolvers: createResolversMap(schema) as any,
});
https://github.com/serverless-stack/serverless-stack/tree/master/examples/graphql-apolloEdward Smith
03/24/2022, 9:32 AMAWS_PROFILE
being set in env variables when app is local? our team occasionally runs it which of course doesn't work . I added it to the top of main, but the debug stack get started prior to the check I addedDimitri van Hees
03/24/2022, 9:51 AMdev
and prod
stages both have their own AWS account. Now, if I want my dev domain to be <http://dev.domain.com|dev.domain.com>
and my prod domain to be <http://www.domain.com|www.domain.com>
, what would be the best approach?
From the guide:
Of course, you can change this if you’d like to use a custom domain for the other stages. You can use something likeShould I just register the domain in the. So for${scope.stage}.<http://my-serverless-app.com|my-serverless-app.com>
it’ll bedev
. But we’ll leave this as an exercise for you.<http://dev.my-serverless-app.com|dev.my-serverless-app.com>
prod
account and manually set the certificates for dev
?Mischa Spiegelmock
03/24/2022, 4:38 PMDillon Peterson
03/24/2022, 5:22 PMJason
03/24/2022, 5:57 PMAdrian Schweizer
03/24/2022, 6:35 PMUncaught Exception {"errorType":"TypeError","errorMessage":"Cannot read property 'push' of undefined",
Casiel Didriksson Muriedas
03/24/2022, 6:37 PMadd-cdk
command? I'm using yarn workspaces.Ross Coundon
03/24/2022, 6:51 PMAshishkumar Pandey
03/24/2022, 11:54 PMUnhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"TypeError: Cannot read properties of undefined (reading 'ServerClient')","reason":"TypeError: Cannot read properties of undefined (reading 'ServerClient')","promise":{},"stack":["Runtime.UnhandledPromiseRejection: TypeError: Cannot read properties of undefined (reading 'ServerClient')"," at process.<anonymous> (file:///Users/ashish/work/planet-marathi/api-v2/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)"," at process.emit (node:events:526:28)"," at process.emit (node:domain:475:12)"," at emit (node:internal/process/promises:140:20)"," at processPromiseRejections (node:internal/process/promises:274:27)"," at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
Any ideas what could be going wrong? The ServerClient
refers to a class in a npm module called postmark
that I use to send emails. Here’s the reference to the lib - http://wildbit.github.io/postmark.js/index.htmlSteven Isley
03/25/2022, 6:00 AMsatish venkatakrishnan
03/25/2022, 7:42 AMERROR build_failure: The function Api::Api.NotificationProcessor::FunctionHandler failed to build
Getting the following error when trying to consume the SQS message in C# . Any help will be appreciatedKuda Zhou
03/25/2022, 9:22 AM{
“name”: “sst-demo”,
“region”: “eu-west-2",
“main”: “stacks/index.ts”
} the also have the pipeline one`{`
"name": "sst-demo",
"region": "eu-west-2",
"main": "ci-cd-stacks/index.ts"
}
Rob N
03/25/2022, 12:55 PMRob N
03/25/2022, 5:24 PMError: Unable to infer GraphQL type from TypeScript reflection system. You need to provide explicit type for parameter #2 of
https://github.com/evanw/esbuild/issues/257
https://github.com/aws/aws-sam-cli/issues/3700Dan Schwartz
03/25/2022, 5:51 PMDan Van Brunt
03/25/2022, 6:08 PMPeter Slattery
03/25/2022, 7:48 PMsst build
on my machine). However when I try and run npm install
(as happens when I try and push to seed) I get the following error:
Invalid package name "@aws-cdk-lib": name can only contain URL-friendly characters
and when I change @aws-cdk-lib to aws-cdk-lib in our package.json file, I get the following error:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for aws-cdk-lib@1.61.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'infrastructure'
npm ERR! notarget
I feel like I'm almost there, but google is turning up nothing. Any advice would be much appreciated!Dan Van Brunt
03/25/2022, 8:10 PMyarn/node_modules
in github actions
? I read this SO and this in the cache action docs as well as this article and no one seems to agree on the best approach. We want things to run as fast as possible and currently with just the following…. it seems to reinstall everything every time… which is LOOOOONG.
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install --frozen-lockfile