Amazon web services AWS amplify:将文件上载到存储器时出错

Amazon web services AWS amplify:将文件上载到存储器时出错,amazon-web-services,amazon-s3,aws-amplify,aws-amplify-vue,Amazon Web Services,Amazon S3,Aws Amplify,Aws Amplify Vue,我正在尝试将用户的私人文件上载到AWS存储,我面临两个问题 a. Storage.put throws a `Uncaught (in promise) No plugin found in Storage for the provider` on my local machine b. when I publish the application to aws, I get `a r[a].trim is not a function, the server responded with a

我正在尝试将用户的私人文件上载到AWS存储,我面临两个问题

a. Storage.put throws a `Uncaught (in promise) No plugin found in Storage for the provider` on my local machine
b. when I publish the application to aws, I get `a r[a].trim is not a function, the server responded with a status of 403 (Forbidden)` error.
我正在使用“@aws amplify/storage”:“^3.1.9”,“@aws amplify/ui vue”:“^0.2.5”,“aws amplify”:“^3.0.11”。我之前已经更新到上述库的最新版本,但我面临同样的问题

生产中的错误:

[WARN] 52:13.681 AWSS3Provider - error uploading TypeError: r[a].trim is not a function
    at P (chunk-vendors.3a69780c.js:96)
    at e.<anonymous> (chunk-vendors.3a69780c.js:96)
    at c (chunk-vendors.3a69780c.js:111)
    at Object.next (chunk-vendors.3a69780c.js:111)
    at s (chunk-vendors.3a69780c.js:111)
import { Auth } from 'aws-amplify';
import Storage from "@aws-amplify/storage";
var i;
        for (i = 0; i < validFilesData.length; i++) 
        {
          let objectToBeUploaded=validFilesData[i];
          let config={level: 'private', contentType: 'video/mp4',};
          let result =await Storage.put('test.mp4', objectToBeUploaded, config);
        }
const awsmobile = {
    "aws_project_region": "us-east-1",
    "aws_cognito_identity_pool_id": "us-east-1:d5bdd6ce-4ef4-4d25-81ac-47bcf08d9007",
    "aws_cognito_region": "us-east-1",
    "aws_user_pools_id": "us-east-1_b6sLX6k7X",
    "aws_user_pools_web_client_id": "6plmdr9nj2oo7hdofugbpctd6l",
    "oauth": {},
    "aws_appsync_graphqlEndpoint": "https://yoxnhmkqojgsjjsmdudy5ytuli.appsync-api.us-east-1.amazonaws.com/graphql",
    "aws_appsync_region": "us-east-1",
    "aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS",
    "aws_cloud_logic_custom": [
        {
            "name": "priceperhour",
            "endpoint": "https://qirua8wpa3.execute-api.us-east-1.amazonaws.com/dev",
            "region": "us-east-1"
        },
        {
            "name": "PaymentIntent",
            "endpoint": "https://kalgi2en0k.execute-api.us-east-1.amazonaws.com/dev",
            "region": "us-east-1"
        },
        {
            "name": "CreatePaymentIntent",
            "endpoint": "https://dplo9lvadc.execute-api.us-east-1.amazonaws.com/dev",
            "region": "us-east-1"
        }
    ],
    "aws_user_files_s3_bucket": "vidaudtranscriptionb772eac002c6449096461a128cad70417-dev",
    "aws_user_files_s3_bucket_region": "us-east-1",
    "aws_content_delivery_bucket": "vidaudtranscription-20200703222552-hostingbucket-dev",
    "aws_content_delivery_bucket_region": "us-east-1",
    "aws_content_delivery_url": "http://vidaudtranscription-20200703222552-hostingbucket-dev.s3-website-us-east-1.amazonaws.com"
};
export default awsmobile;
import Amplify,{Storage} from 'aws-amplify';
import '@aws-amplify/ui-vue';
import aws_exports from './aws-exports';
Amplify.configure(aws_exports);
main.js:

[WARN] 52:13.681 AWSS3Provider - error uploading TypeError: r[a].trim is not a function
    at P (chunk-vendors.3a69780c.js:96)
    at e.<anonymous> (chunk-vendors.3a69780c.js:96)
    at c (chunk-vendors.3a69780c.js:111)
    at Object.next (chunk-vendors.3a69780c.js:111)
    at s (chunk-vendors.3a69780c.js:111)
import { Auth } from 'aws-amplify';
import Storage from "@aws-amplify/storage";
var i;
        for (i = 0; i < validFilesData.length; i++) 
        {
          let objectToBeUploaded=validFilesData[i];
          let config={level: 'private', contentType: 'video/mp4',};
          let result =await Storage.put('test.mp4', objectToBeUploaded, config);
        }
const awsmobile = {
    "aws_project_region": "us-east-1",
    "aws_cognito_identity_pool_id": "us-east-1:d5bdd6ce-4ef4-4d25-81ac-47bcf08d9007",
    "aws_cognito_region": "us-east-1",
    "aws_user_pools_id": "us-east-1_b6sLX6k7X",
    "aws_user_pools_web_client_id": "6plmdr9nj2oo7hdofugbpctd6l",
    "oauth": {},
    "aws_appsync_graphqlEndpoint": "https://yoxnhmkqojgsjjsmdudy5ytuli.appsync-api.us-east-1.amazonaws.com/graphql",
    "aws_appsync_region": "us-east-1",
    "aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS",
    "aws_cloud_logic_custom": [
        {
            "name": "priceperhour",
            "endpoint": "https://qirua8wpa3.execute-api.us-east-1.amazonaws.com/dev",
            "region": "us-east-1"
        },
        {
            "name": "PaymentIntent",
            "endpoint": "https://kalgi2en0k.execute-api.us-east-1.amazonaws.com/dev",
            "region": "us-east-1"
        },
        {
            "name": "CreatePaymentIntent",
            "endpoint": "https://dplo9lvadc.execute-api.us-east-1.amazonaws.com/dev",
            "region": "us-east-1"
        }
    ],
    "aws_user_files_s3_bucket": "vidaudtranscriptionb772eac002c6449096461a128cad70417-dev",
    "aws_user_files_s3_bucket_region": "us-east-1",
    "aws_content_delivery_bucket": "vidaudtranscription-20200703222552-hostingbucket-dev",
    "aws_content_delivery_bucket_region": "us-east-1",
    "aws_content_delivery_url": "http://vidaudtranscription-20200703222552-hostingbucket-dev.s3-website-us-east-1.amazonaws.com"
};
export default awsmobile;
import Amplify,{Storage} from 'aws-amplify';
import '@aws-amplify/ui-vue';
import aws_exports from './aws-exports';
Amplify.configure(aws_exports);

我已经为aws amplify团队添加了一个问题

我通过使用承诺而不是异步\await,通过更改 已更改
let result=wait Storage.put('test.mp4',objectToBeUploaded,config)

Storage.put('test.mp4', objectToBeUploaded,config).then(async function(result) 
{console.log(`result : ${JSON.stringify(result)}`);})

我通过使用承诺而不是async\await,通过更改 已更改
let result=wait Storage.put('test.mp4',objectToBeUploaded,config)

Storage.put('test.mp4', objectToBeUploaded,config).then(async function(result) 
{console.log(`result : ${JSON.stringify(result)}`);})