如何修复AWS上缺少的区域
我目前正在使用AWS AMPLIFY的VUE2 JS,我遵循了Amplify CLI指令,但是在测试存储后,我
Uncaught (in promise) Error: Region is missing
at resolveRegionConfig (RegionConfig.ts?69ec:34:1)
at new S3Client (S3Client.ts?6464:654:1)
at createS3Client (S3ClientUtils.ts?2e7b:156:1)
at AWSS3ProviderManagedUpload._createNewS3Client (AWSS3ProviderManagedUpload.ts?8398:321:1)
at new AWSS3ProviderManagedUpload (AWSS3ProviderManagedUpload.ts?8398:73:1)
at AWSS3Provider.put (AWSS3Provider.ts?1d18:563:1)
at Storage.put (Storage.ts?d867:343:1)
at _callee$ (adminLayout.vue?2208:168:1)
at tryCatch (regeneratorRuntime.js?525a:86:1)
at Generator.eval [as _invoke] (regeneratorRuntime.js?525a:66:1)
在这里遇到了一个错误。JSON
{
"name": "basementlore",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"@aws-amplify/api": "^4.0.42",
"@aws-amplify/pubsub": "^4.4.3",
"aws-amplify": "^4.3.23",
"core-js": "^3.8.3",
"janu-vuetify-form-generator": "^0.0.24",
"register-service-worker": "^1.7.2",
"vue": "^2.6.14",
"vue-router": "^3.5.1",
"vuetify": "^2.6.6",
"vuex": "^3.6.2"
},
"devDependencies": {
"@mdi/font": "^6.7.96",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-pwa": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"deepmerge": "^4.2.2",
"sass": "~1.32",
"sass-loader": "^12.6.0",
"vue-template-compiler": "^2.6.14"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
我也尝试检查路径C:\ Users \ users \ My pc.aws \ config 但是它在配置文件上有一个区域。
在我的主角上,
import { Storage, Amplify,Auth } from 'aws-amplify';
import awsconfig from './aws-exports';
// Amplify.configure(awsconfig);
Amplify.configure({
Auth: {
identityPoolId: 'my_pool_key', //REQUIRED - Amazon Cognito Identity Pool ID
region: 'ap-southeast-1', // REQUIRED - Amazon Cognito Region
},
Storage: {
AWSS3: {
bucket: 'my_bucket_name', //REQUIRED - Amazon S3 bucket name
region: 'ap-southeast-1'
}
}
});
Auth.configure()
我没有在哪里做错了什么事,因为我只是遵循此 https://docs.amplify.aws/cli/start/start/install/#pre-requisites-for-installation
I am currently using vue2 js with aws amplify I followed the amplify cli instruction but after testing the storage i got an error
Uncaught (in promise) Error: Region is missing
at resolveRegionConfig (RegionConfig.ts?69ec:34:1)
at new S3Client (S3Client.ts?6464:654:1)
at createS3Client (S3ClientUtils.ts?2e7b:156:1)
at AWSS3ProviderManagedUpload._createNewS3Client (AWSS3ProviderManagedUpload.ts?8398:321:1)
at new AWSS3ProviderManagedUpload (AWSS3ProviderManagedUpload.ts?8398:73:1)
at AWSS3Provider.put (AWSS3Provider.ts?1d18:563:1)
at Storage.put (Storage.ts?d867:343:1)
at _callee$ (adminLayout.vue?2208:168:1)
at tryCatch (regeneratorRuntime.js?525a:86:1)
at Generator.eval [as _invoke] (regeneratorRuntime.js?525a:66:1)
Here is my package.json
{
"name": "basementlore",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"@aws-amplify/api": "^4.0.42",
"@aws-amplify/pubsub": "^4.4.3",
"aws-amplify": "^4.3.23",
"core-js": "^3.8.3",
"janu-vuetify-form-generator": "^0.0.24",
"register-service-worker": "^1.7.2",
"vue": "^2.6.14",
"vue-router": "^3.5.1",
"vuetify": "^2.6.6",
"vuex": "^3.6.2"
},
"devDependencies": {
"@mdi/font": "^6.7.96",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-pwa": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"deepmerge": "^4.2.2",
"sass": "~1.32",
"sass-loader": "^12.6.0",
"vue-template-compiler": "^2.6.14"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
I also have tried to check the path C:\Users\MY PC.aws\config
but it has a region on the config file.
and on my main.js
import { Storage, Amplify,Auth } from 'aws-amplify';
import awsconfig from './aws-exports';
// Amplify.configure(awsconfig);
Amplify.configure({
Auth: {
identityPoolId: 'my_pool_key', //REQUIRED - Amazon Cognito Identity Pool ID
region: 'ap-southeast-1', // REQUIRED - Amazon Cognito Region
},
Storage: {
AWSS3: {
bucket: 'my_bucket_name', //REQUIRED - Amazon S3 bucket name
region: 'ap-southeast-1'
}
}
});
Auth.configure()
I dont where I have done soemthing wrong because i just followed this https://docs.amplify.aws/cli/start/install/#pre-requisites-for-installation
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论