Skip to content

Unnecessary warning for AWS S3 provider plugin #16360

@swapzone

Description

@swapzone

Bug report

Required System information

  • Node.js version: v18.14.1
  • NPM version: 9.3.1
  • Strapi version: 4.9.1
  • Database: MySQL
  • Operating system: MacOS Ventura 13.3.1
  • Is your project Javascript or Typescript: Javascript

Describe the bug

When starting the Strapi server, there is a warning in the console:

Warning: S3 configuration options passed at root level of the plugin's providerOptions is deprecated and will be removed in a future release. Please wrap them inside the 's3Options:{}' property.

Steps to reproduce the behavior

  1. Add the AWS S3 Provider Plugin
  2. Configure the plugin as described here: https://market.strapi.io/providers/@strapi-provider-upload-aws-s3
  3. Start the Strapi server.

Expected behavior

I would expect the warning not to be there, when I configure the AWS S3 plugin as described in the docs.

Additional context

I was stumbling across the following line of code:

legacyS3Options will always be an object and so this check will always be true. I would suggest a check like Object.keys(legacyS3Options).length > 0 instead to only show the warning, when there are options in the old legacy format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: invalid templateAutomation Flag to handle invalid bug report templates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions