最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - SSTOpenNext Lambda Edge Function Deployment Error - Stack Overflow

programmeradmin3浏览0评论

I am trying to deploy a Next JS app to AWS with OpenNext. One thing is that I am trying to use the new v.3 feature where you can have external middleware (). However, it seems that when the middleware Lambda Edge function is being created, OpenNext is adding a bunch of environemnt variables, even though lambda edge functions don't allow that. This is the particular deploy error I am receiving:

Site sst:aws:Nextjs → SiteCdnDistribution aws:cloudfront:Distribution sdk-v2/provider2.go:515: sdk.helper_schema: updating CloudFront Distribution (123): operation error CloudFront: UpdateDistribution, https response error StatusCode: 400, RequestID: 69b2ada4-1f61-4faf-96c1-4e04c714b4b7, InvalidLambdaFunctionAssociation: The function cannot have environment variables. Function: arn:aws:lambda:us-east-1:123:function:ashrae-research-test-SiteEdgeMiddlewareFunction-erhbndat:9: [email protected]

View more in the console: /u/ede7c640

ELIFECYCLE  Command failed with exit code 1.

It doesn't make sense to me why OpenNext would be creating this Lambda Edge external middleware function if this is an inherent limitation of Lambda Edge functions. Is there some way to prevent this?

Here is my open next config file:

const config = {
    default: {},
    middleware: {
        external: true,
    },

}

export default config;
发布评论

评论列表(0)

  1. 暂无评论