Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants