question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vue js - Cannot read property 'configure' of undefined

See original GitHub issue

Describe 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

image

Expected behavior The site to render in both development and production builds

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:19 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
sawyerhcommented, Jul 29, 2020

Looks like this may only be an issue when importing the default export:

import Amplify from "aws-amplify"; // 🛑

The issue seems to be resolved if you use the named export instead:

import { Amplify } from "aws-amplify"; // ✅
2reactions
siegertscommented, Aug 5, 2020

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.

  "@aws-amplify/ui-vue": "^0.2.12",
  "aws-amplify": "^3.0.22",
  "aws-amplify-vue": "^2.1.2",
  "core-js": "^3.6.5",
  "vue": "^2.6.11"
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found