Replies: 3 comments 6 replies
-
this is my stack trace "stack": "TypeError: this.adapter.config.endpoint is not a function\n at S3Driver.getUrl (/node_modules/@adonisjs/drive-s3/build/src/Drivers/S3.js:220:66)\n at File.moveToDisk (/node_modules/@adonisjs/bodyparser/build/src/Multipart/File.js:177:44)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at Attachment.save |
Beta Was this translation helpful? Give feedback.
-
@thetutlage @RomainLanz it seem like s3 driver require S3_ENDPOINT instead of let it optional |
Beta Was this translation helpful? Give feedback.
-
Hello Reason/node_modules/@adonisjs/drive-s3/build/src/Drivers/s3.js
// Returns URL to a given path
async getUrl(location) {
/**
* Use the CDN URL if defined
*/
if (this.config.cdnUrl) {
return `${this.config.cdnUrl}/${location}`;
}
const href = (0, url_1.format)(await this.adapter.config.endpoint()); // this line
if (href.startsWith('https://s3.amazonaws')) {
return `https://${this.config.bucket}.s3.amazonaws.com/${location}`;
}
return `${href}/${this.config.bucket}/${location}`;
} How can you fix/config/drive.ts export default driveConfig({
...
s3: {
....
cdnUrl: Env.get('S3_CDN_URL'), // add this line S3_CDN_URL = https://bucketName.region.amazonaws.com
},
},
}) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I get this.adapter.config.endpoint is not a function* like error when i use
moveToDisk() fonction
Beta Was this translation helpful? Give feedback.
All reactions