0

我的 AWS 放大应用程序使用存储。当我运行应用程序时出现No plugin found in Storage for the provider错误。我尝试过的一些事情是:

a. removing and adding storage module by `amplify add\remove storage` commands.
b. Manually configuring storage in main.js based on this [github issue][1]. 
c. deleting the application's node_modules and adding them again. 

我会错过什么?

主.js:

import Amplify,{Auth, Storage} from 'aws-amplify';
import '@aws-amplify/ui-vue';
import aws_exports from './aws-exports';
Amplify.configure(aws_exports);

main.js:添加了代码以根据此github 问题手动配置存储:

Amplify.configure({
    Auth: {
        identityPoolId: '<IdentityPoolId>', 
        region: "<region>", 
        userPoolId: "<userPoolId>", 
        userPoolWebClientId: "<userPoolWebClientId>", 
    },
    
    Storage: {
        AWSS3: {
            bucket: "<bucket>",
            region: "<region>",
        }
    }
});

堆栈跟踪:

Uncaught (in promise) No plugin found in Storage for the provider
(anonymous) @ 4.js:241
step @ 4.js:69
(anonymous) @ 4.js:50
(anonymous) @ 4.js:44
push../node_modules/@aws-amplify/storage/lib-esm/Storage.js.__awaiter @ 4.js:40
push../node_modules/@aws-amplify/storage/lib-esm/Storage.js.Storage.put @ 4.js:234
_loop$ @ 18.js:286
tryCatch @ vendors~app.js:455791
invoke @ vendors~app.js:456017
prototype.<computed> @ vendors~app.js:455843
tryCatch @ vendors~app.js:455791
maybeInvokeDelegate @ vendors~app.js:456080
invoke @ vendors~app.js:455991
prototype.<computed> @ vendors~app.js:455843
asyncGeneratorStep @ vendors~app.js:162870
_next @ vendors~app.js:162892
(anonymous) @ vendors~app.js:162899
F @ vendors~app.js:319219
(anonymous) @ vendors~app.js:162888
TranscribeFiles @ 18.js:392
invokeWithErrorHandling @ vendors~app.js:433345
invoker @ vendors~app.js:433670
invokeWithErrorHandling @ vendors~app.js:433345
Vue.$emit @ vendors~app.js:435374
clickButton @ vendors~app.js:444622
click @ vendors~app.js:444498
invokeWithErrorHandling @ vendors~app.js:433345
invoker @ vendors~app.js:433670
original._wrapper @ vendors~app.js:438399
4

1 回答 1

0

我能够让应用程序正常工作

a. removing the manual configuration in main.js, 
b. removing storage completely, 
c. publishing the application to aws, 
d. adding storage back again and publishing the application to aws. 
于 2020-07-03T05:50:26.330 回答