> :loudspeaker: Major Update In v0.59.0, we upd...
# general
f
📢 Major Update
In v0.59.0, we updated to CDK v2. I know major upgrades are often painful, but I want to make sure the update is easy and smooth for everyone. So I added a 5 step list to the release note. It shouldn’t take more than 5-15 minutes, depending on the size of your app. If you have any questions, feel free to shoutout in the #help channel.
a
Why they changed from
-
to
_
?
What’s the reason?
f
lol yeah.. just watch out that if you are using
alpha
packages, they are still using
-
🤷‍♂️
m
Do we have to run
cdk bootstrap
f
@Michael Wolfenden You shouldn’t have to. Are you getting an error?
m
Running
cdk bootstrap
resolved the issue, but I don't remember ever having to do that with cdk v1
f
I see. Can you still get to the console output to take a screenshot of the error?
m
Sorry, not anymore. It was exactly the same message as in the doc
Copy code
MyStack failed: Error: MyStack: SSM parameter /cdk-bootstrap/hnb659fds/version not found. Has the environment been bootstrapped? Please run 'cdk bootstrap' (see <https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html>)
    at CloudFormationDeployments.validateBootstrapStackVersion (.../aws-cdk/lib/api/cloudformation-deployments.ts:323:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
MyStack: SSM parameter /cdk-bootstrap/hnb659fds/version not found. Has the environment been bootstrapped? Please run 'cdk bootstrap' (see <https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html>)
r
Depending on when your first ran the CDK, it might have to re-bootstrap to upgrade to the most recent bootstrap stack.
f
@Michael Wolfenden @Richard Simpson Fixed in v0.59.1. SST should help you auto bootstrap if the account hasn’t been bootstrapped.
s
Awesome stuff 👍
a
Do you have instructions for not using
sst update
? I assume it still doesn't play nice with NPM workspaces.
f
Thanks @Simon Reilly
@Adam Fanello yeah you can update
package.json
manually: 1. set
@serverless-stack/*
to
0.59.1
2. change all
@aws-cdk/aws-*
that are listed in the alpha packages list to
@aws-cdk/aws-*-alpha
and set the version to
2.7.0-alpha.0
3. if you have
@aws-cdk/core
or other
@aws-cdk/aws-*
dependencies, remove them, and add
aws-cdk-lib
with version
2.7.0
4. run yarn/npm install 5. do step 3 and 5 in the release note
d
@Frank, just wanted to let you know that this exists: https://github.com/aws/aws-cdk/blob/master/packages/aws-cdk-migration/README.md
j
I posted a message in #help, but did anyone else get
Error: Cannot find module 'colors/safe'
?
f
Oh thanks @Derek Kershner, that could’ve saved me an hour 😬
@Jon Holman lemme follow up in the #help thread
u
Hello 🙂 I followed the guide to update but I have this error when trying to do the diff of starting the project
Copy code
internal/modules/cjs/loader.js:443
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './core' is not defined by "exports" in /home/amai/projects/myproject-api/node_modules/aws-cdk-lib/package.json
    at throwExportsNotFound (internal/modules/esm/resolve.js:290:9)
    at packageExportsResolve (internal/modules/esm/resolve.js:513:3)
    at resolveExports (internal/modules/cjs/loader.js:437:36)
    at Function.Module._findPath (internal/modules/cjs/loader.js:477:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:872:27)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/amai/projects/myproject-api/.build/lib/index.js:2645:30)
    at Module._compile (internal/modules/cjs/loader.js:1068:30) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
m
I had that as well and for me it was caused by still having a
@aws-cdk/core
import in my code
u
strange i m pretty sure to removed them except the alpha
ah ok i had a bad replace
d
Just as an update, I have done about 20 apps of all types, some CDK, some SST, and I have had very little issues, and Frank's time estimate holds true. Alpha packages have encompassed nearly all oddities.