Open jlaramie opened 3 years ago
Are you using build.useV2Handlers? Those files referenced only apply when enabling that (it's basically a refactor of the handlers to be more platform agnostic, but right not it’s experimental and not enabled by default)
Based on the hash regeneration-handler-410de241.js
it looks like you are not using the new v2 handlers. So those files referenced won't apply since they are for the new ones (and the regeneration event structure is different).
It is indeed failing on this line:
const normalizedUri = regenerationEvent.pageS3Path
.replace(`static-pages/${manifest.buildId}`, "")
.replace(".js", "");
pageS3Path
should be passed in from here: https://github.com/serverless-nextjs/serverless-next.js/blob/02bf313c287556980f95c540cfa8df04f5974b2e/packages/libs/lambda-at-edge/src/lib/triggerStaticRegeneration.ts#L41-L49
Can you try to inspect the SQS queue (poll it) and see what the message structure looks like? And probably also post what your default handler folder looks like just to confirm it's using the right version.
Issue Summary
I noticed a weird error on some of my ISG pages and I think I tracked it down to a change introduced in 3.4.0 / https://github.com/serverless-nextjs/serverless-next.js/pull/1731/files . There seems to be a couple of files that were not updated to support the new
pageS3Path
property when callingtriggerStaticRegeneration
.I don't fully understand all the connections but I think these files are at fault:
packages\libs\core\src\defaultHandler.ts
packages\libs\core\src\platform\platformClient.ts
packages\libs\aws-common\src\awsPlatformClient.ts
https://github.com/serverless-nextjs/serverless-next.js/compare/v3.3.0...v3.4.0 This shows all the changes from the pull request in 3.4.0. While I didn't test in the latest Alpha looking at the comparison I think it still exists as an issue https://github.com/serverless-nextjs/serverless-next.js/compare/v3.4.0...v3.5.0-alpha.1
Actual behavior
Expected behavior
pageS3Path
should be included in the SQS eventSteps to reproduce
Screenshots/Code/Configuration/Logs
Versions
Additional context
Checklist
latest
oralpha
@sls-next/serverless-component
release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.