sst / sst

Build modern full-stack applications on AWS

Home Page:https://sst.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Breaking Change in 2.40.0

san4d opened this issue · comments

Problem

I think a breaking change was introduced in 2.40.0:
https://github.com/sst/sst/releases/tag/v2.40.0

Function constructs cannot return objects of constructs. This was possible in 2.39.13.

Steps to reproduce

  1. Here's a minimal construct and stack:
// sst.config.ts
function SimpleStack({stack}: StackContext) {
    return {
        a: new Config.Parameter(stack, "test-param-a", { value: "some-value" })
    }
}
export default {
    config(_input) {
        return {
            name: appName,
            region: 'us-east-2',
        }
    },
    stacks(app) {
        app.stack(SimpleStack, {id: 'simple-stack'})
    },
} as SSTConfig
  1. Versions
  "devDependencies": {
    "aws-cdk-lib": "2.124.0",
    "constructs": "10.3.0",
    "sst": "2.40.0",
  }
  1. Run sst dev.
SST v2.40.0  ready!

➜  App:     app
   Stage:   stage
   Console: https://console.sst.dev/local/app/stage

⠋  simple-stack PUBLISH_ASSETS_IN_PROGRESS
[50%] fail: Unrecognized asset type: '[object Object]'
|  simple-stack PUBLISH_ASSETS_COMPLETE 
⠋  Deploying...

✖  Errors
   simple-stack UPDATE_FAILED
   stack: Failed to publish one or more assets. See the error messages above for more information.
  1. Downgrade sst to 2.39.13 and repeat (3)
SST v2.39.13  ready!

➜  App:     app
   Stage:   stage
   Console: https://console.sst.dev/local/app/stage

|  simple-stack PUBLISH_ASSETS_COMPLETE 
|  simple-stack test-param-a/Parameter_value AWS::SSM::Parameter CREATE_COMPLETE 
|  simple-stack CustomResourceHandler/ServiceRole AWS::IAM::Role CREATE_COMPLETE 
|  simple-stack CustomResourceHandler AWS::Lambda::Function CREATE_COMPLETE 
|  simple-stack AWS::CloudFormation::Stack CREATE_COMPLETE 

✔  Deployed:
   simple-stack

Discord Link

https://discord.com/channels/983865673656705025/1205269370557964298

commented

Taking a look!

There was no issue directly with 2.40.0. This ended up being a result of having different versions of SST in a pnpm monorepo. Placing all packages in the monorepo on the same SST version resolved the issue.

Apologies for the false alarm and delayed response here.

I am also using PNPM and I had the same issue. All I had to do is make sure all packages in the PNPM workspace have the same version of SST.