https://serverless-stack.com/ logo
#help
Title
# help
a

Adrian Schweizer

11/11/2021, 10:33 PM
I'm still a bit hampered by the trailing export thing. Is there a way to manually interact with cdk to remove an export that was created by SST? I can't delete it over the AWS GUI and from googling a bit, it seems to only be possible to remove it in the cdk templates, of which I know next to nothing, unfortunately
it's not a stopper for me, because I can simply deploy to another stage, but it's a bit annoying if I or a coworker forgets it
t

thdxr

11/11/2021, 10:37 PM
What I do is do
sst deploy --stack=stack_that_stopped_referencing
to deploy them out of order
That way the stack that stopped referencing it is deployed first. And then I normal deploy should work
a

Adrian Schweizer

11/11/2021, 11:09 PM
hmmm, and the stack you deploy is the stack that references the trailing export?
t

thdxr

11/11/2021, 11:11 PM
yeah
a

Adrian Schweizer

11/11/2021, 11:12 PM
ah, i think you already suggested this last time, and I tried it, but now I get an error, that AWSMock is missing
Could not resolve "mock-aws-s3"
t

thdxr

11/11/2021, 11:12 PM
The scenario I'm familiar with is 1. In a deployed app, B references A 2. You rewrite your stack code so B no longer references A 3. CDK realizes A no longer needs to export anything 4. During deploy, it tries to update A to remove the export, but it can't because old B is still referencing it So the solution of deploying only B first and then doing a normal deploy fixes the ordering
a

Adrian Schweizer

11/11/2021, 11:13 PM
that sounds like what's happening here
but it seems I can't deploy single stacks, because of that error above
hmmm, it also happens when I try to deploy the whole app
Copy code
> node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:43:28: error: Could not resolve "mock-aws-s3" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)
    43 │     const AWSMock = require('mock-aws-s3');
       ╵                             ~~~~~~~~~~~~~

 > node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:112:23: error: Could not resolve "nock" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)
    112 │   const nock = require('nock');
npm install didn't help...i thought maybe I'm missing some deps
t

thdxr

11/12/2021, 12:12 AM
ah ok so that issue is coming from something in your code referencing mapbox
do you know what function is doing that?
a

Adrian Schweizer

11/12/2021, 12:19 AM
hmmm, it's not from my code, but I was messing around with amplify earlier and used the cli, maybe it added a dep to it
anyway, if it's not something obvious, I'm gonna dig a bit deeper
seems to be a dep from the bcrypt module
t

thdxr

11/12/2021, 12:36 AM
can you show me more of the log?
I can maybe help you find which construct it's coming form
a

Adrian Schweizer

11/12/2021, 12:47 AM
I just had to npm i those packages...bcrypt is building something with node-gyp, and maybe it requires those modules when it detects aws config, but they are not listed as regular requirements or something...
it's weird
it only needs them on deploy, not on start
anyway, i still got problems with the export
here it is in the gui:
I changed the name of the users table in the Storage stack, then deployed, which worked
but when I change it back and deploy again, it says the export already exists
Copy code
Error: Export with name dev-convento-storage:ExportsOutputRefUsersTable6D91A5EE2FC965A7 is already exported by stack dev-convento-storage. Rollback requested by user.
i'll probably have to live with another stage name
I just hope it doesn't happen again