arabold / serverless-export-env

Serverless plugin to export environment variables into a .env file
MIT License
102 stars 34 forks source link

.return is not a function #26

Closed DanielWFrancis closed 3 years ago

DanielWFrancis commented 3 years ago

Builds started failing on my export-env call with this

Type Error ---------------------------------------------

  TypeError: AWS.request(...).then(...).return is not a function
      at describeStack (/home/circleci/.../node_modules/serverless-export-env/src/lib/collectStackOutputs.js:16:12)

I don't actually write much Javascript but I went through removing the . for the above instance and two more instances that threw errors:

TypeError: AWS.request(...).then(...).return is not a function
      at listStackResources (/home/circleci/.../node_modules/serverless-export-env/src/lib/resolveCloudFormationEnvVariables.js:32:12)
TypeError: AWS.request(...).tap is not a function
      at listExports (/home/circleci/.../node_modules/serverless-export-env/src/lib/resolveCloudFormationEnvVariables.js:9:6)

Not sure if this solution creates race conditions etc., but it ran fine just now. Also curious about what changed to cause this to not work?

Thank you :)

pdecarcer commented 3 years ago

I run on a mac just fine, but when I try tu run on a ubuntu get TypeError: AWS.request(...).then(...).return is not a function Error

ivanamandic commented 3 years ago

Hi, I just updated serverless framework and now serverless export-env -s develop not working any more. I get AWS.request(...).then(...).return is not a function error.

coyoteecd commented 3 years ago

Also ran into this today after updating to serverless v2.23. I think this is related to these refactors: https://github.com/serverless/serverless/pull/8871/commits/b5a70fbdbbbf9145ce210c562ffac666d32e7d7b

Serverless Framework is slowly deprecating BbPromise and replacing it with native async/await. This plugin, and possibly others, uses BbPromise and also assumes that async operations from serverless are BbPromise instances. Not anymore, it seems.

pdecarcer commented 3 years ago

@coyoteecd So you propose to downgrade serverless before v2.23??

DanielWFrancis commented 3 years ago

@coyoteecd interesting. Does seem relevant, but rolling back to v2.20.1 still is returning the error oddly enough.

From my last run, which ended with the same error as in the op:

  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              10.19.0
     Framework Version:         2.20.1
     Plugin Version:            4.4.2
     SDK Version:               2.3.2
     Components Version:        3.6.2

EDIT: never mind, the revert worked. Serverless kept running a local version in node_modules.

pdecarcer commented 3 years ago

I just installed version 2.22.0 and worked with out a problem!

gerdzhikov commented 3 years ago

Same problem here after upgrading to serverless 2.27.0 running it on OSX:

 Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:                  14.16.0
     Framework Version:        2.27.0 (local)
     Plugin Version:                4.4.3
     SDK Version:                   2.3.2
     Components Version:     3.7.1

Can confirm, that it works for me fine with 2.22.0

williamsandonz commented 3 years ago

Would be great to get this one solved

williamsandonz commented 3 years ago

Hey everyone, I've taken a look into this and the issue was actually fixed in the github repo here but a new npm package hasn't been published, so if you need a temp work around just npm install arabold/serverless-export-env to get the changes, then can switch back to NPM package once released. @arabold you able to publish a new version so that everyone can get their updates? Would also appreicate if you could check out my PR (unrelated) about the overwrite flag.

pgrzesik commented 3 years ago

Hello @arabold :wave: As @williamsandonz mentioned above, the fix has been merged, but the new version wasn't released to npm. Would you be able to release a new version? If you're no longer interested in maintaining the plugin, I'm happy to jump in and help out with such maintenance - please let me know if that sounds good :bow:

nthornton2010 commented 3 years ago

@arabold any update on when this fix will make it to npm?

huntedman commented 3 years ago

As a temporary workaround, untill NPM is updated, you can do:

npm i -D https://github.com/arabold/serverless-export-env.git

It installs the dependency straight from github, skipping the NPM.

arabold commented 3 years ago

Fixed in v1.4.2. Sorry for the delay 😞