I have an issue getting AWS S3 to save images straight to AWS S3.
I tried to import the AWS package as a plugin but it doesn't work.
I do have the following in my nuxt.config.js
plugins: [
...
'~plugins/S3.js'
],
in my plugins/s3.js
import vue from "vue"
import S3 from "aws-s3";
vue.use(S3)
and I try to use it in my file
const S3Client = new S3(config)
S3Client
.uploadFile(file, this.getRandomName(10))
.then(data => {
console.log(data)
})
.catch(err => {
console.log(err)
})
I get the error
multiplephotoupload.vue?7624:110 Uncaught (in promise) ReferenceError: S3 is not defined
If I write it directly into my component, this is defined and working
import S3 from "aws-s3";