Hi! Upgrading from 0.7.3 to 0.8.0gives me errors w...
# help
p
Hi! Upgrading from 0.7.3 to 0.8.0gives me errors when setting timeouts on functions. I set it like so: `timeout: cdk.Duration.seconds(240)`and get the following error:
Copy code
===============
 Deploying app
===============

Preparing your SST app
Transpiling source
Linting source
Deploying stacks

Error: Argument to Intrinsic must be a plain value object, got () => {
      throw new Error('Duration.toString() was used, but .toSeconds, .toMinutes or .toDays should have been called instead');
    }
  at new Intrinsic (/Users/pal/dev/peasy/node_modules/@aws-cdk/core/lib/private/intrinsic.ts:39:13)
  at Function.asAny (/Users/pal/dev/peasy/node_modules/@aws-cdk/core/lib/token.ts:102:48)
  at Function.asString (/Users/pal/dev/peasy/node_modules/@aws-cdk/core/lib/token.ts:79:53)
  at Duration.toString (/Users/pal/dev/peasy/node_modules/@aws-cdk/core/lib/duration.ts:219:18)
  at new Duration (/Users/pal/dev/peasy/node_modules/@aws-cdk/core/lib/duration.ts:95:46)
  at Function.seconds (/Users/pal/dev/peasy/node_modules/@aws-cdk/core/lib/duration.ts:29:12)
  at new Function (/Users/pal/dev/peasy/node_modules/@serverless-stack/resources/src/Function.ts:127:31)
  at createFunction (/Users/pal/dev/peasy/lib/cdk-common.js:96:10)
  at new AnalysisStack (/Users/pal/dev/peasy/services/analysis/sst-stack.js:27:38)
  at Object.main (/Users/pal/dev/peasy/lib/index.js:11:3)

There was an error synthesizing your app.
error Command failed with exit code 1.
Downgrading to
0.7.3
fixes this
f
Hey @Pål Brattberg we made some small changes to the
sst.Function
construct,
runtime
takes a number directly rather than a
cdk.Duration
object.
We will try to keep breaking changes to minimal moving forward.
p
Ah, I see. Thanks for letting me know! 👍