Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS is not defined #581

Open
peebles opened this issue Aug 3, 2022 · 1 comment
Open

AWS is not defined #581

peebles opened this issue Aug 3, 2022 · 1 comment

Comments

@peebles
Copy link

peebles commented Aug 3, 2022

In version 0.6.22, I am getting:

ReferenceError: AWS is not defined
at ServerlessS3Local.getClient (/Users/peebles/cortina/ca-portal/node_modules/serverless-s3-local/index.js:353:21)
at ServerlessS3Local.createBuckets (/Users/peebles/cortina/ca-portal/node_modules/serverless-s3-local/index.js:325:27)
...

And indeed, in index.js line 353 there is a reference to AWS that was never defined:

  getClient() {
    const { S3 } = require("@aws-sdk/client-s3");
    return new S3({
      s3ForcePathStyle: true,
      endpoint: new AWS.Endpoint(
        `http://${this.options.host}:${this.options.port}`
      ),
      accessKeyId: this.options.accessKeyId,
      secretAccessKey: this.options.secretAccessKey,
    });
  }

Or am I missing something here?

0.6.20 works without error.

@filipemacedo
Copy link

Where do you import AWS?

See an example:

import { S3, Endpoint } from "aws-sdk";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants