Vue js - Cannot read property 'configure' of undefined
See original GitHub issueDescribe the bug I’ve followed the instructions here:
https://docs.amplify.aws/start/q/integration/vue
My site works great locally with a development build, but as soon as i run a production build i get a blank site with
Cannot read property 'configure' of undefined
error in the console
To Reproduce Steps to reproduce the behavior:
Add amplify to an empty vue js component, with this in main.js:
import Amplify from 'aws-amplify';
import '@aws-amplify/ui-vue';
import aws_exports from './aws-exports';
Amplify.configure(aws_exports);
Run yarn serve
- ✅ works as expected
Run yarn build
, and run the output with http-server
or other - ❌ build succeeds, but site is blank, with this error in the console:
Cannot read property 'configure' of undefined
Expected behavior The site to render in both development and production builds
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:19 (3 by maintainers)
Top Results From Across the Web
VueJS = Uncaught TypeError: Cannot read property 'settings ...
One solution is to use a normal function and predefine the property url in settings : new Vue({ el: '#app', data() { return...
Read more >TypeError: Cannot read property 'options' of undefined
After working through a major npm package update, I am getting an error thrown from my nuxt config file… I haven't found a...
Read more >Vue: TypeError: Cannot read property of undefined. - Laracasts
My data works fine and populates the template, however I get warning: vue.js:2215 TypeError: Cannot read property 'short_name' of undefined.
Read more >uncaught typeerror: cannot read properties of undefined ...
启动项目时出现Uncaught TypeError: Cannot read properties of undefined (reading 'install')这个错误,检查了下是自己的vue-router安装的版本错误,我写的项目是vue2, ...
Read more >[Vue 3 & Vite 2] Uncaught (in promise) TypeError: Cannot read ...
@auth0/auth0-spa-js: v1.21.0 node: v16.13.0 vue-router: v4.0.14 vue: ... Cannot read properties of undefined (reading 'isAuthenticated').
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like this may only be an issue when importing the default export:
The issue seems to be resolved if you use the named export instead:
I created a small POC with Vue v3 that failed with the above error. In my case, it looks like the errors may be related to the plugin not being updated for Vue 3.
At a top-level glance:
After rolling back to Vue v2.6.11 (below), I was able to successfully test locally, and deploy (publish) without the error.